I am parsing a text file which contain python "string" inside it. For e.g.:
'my_home1' in houses.split(',') and '2018' in iphone.split(',') and 14 < mask
for the example above, I wrote a possible dictionary:
dict = {'house' : 'my_home1,my_home2', 'iphone' : '2015,2018', 'mask' : '15' }
but dict
is not know in advance and will be adapted during the running time of the python script.
I would like to replace all the appearance of keys inside the string above in a dynamic way and then to evaluate the expression.