Let's say that I have a line of code that is a string:
a="print 'x + y = ', x + y"
Now I want to execute it using eval()
So if I have already given x & y values beforhand, I know that can write:
eval (compile (a,"test.py", "single"))
And it will work great.
But I want to give them values from a dict. In other words, if I have a dict:
b={'x':4,'y':3}
I want the values that will go into x & y to come from b.
How do I do this?