How to get/set local variables of a function (from outside) in Python?
If I have a function (in Python 2.5.2) like: def sample_func(): a = 78 b = range(5) #c = a + b[2] – x My questions are: How to get the local variables (a,b) of the function from outside without using locals() inside the function? (kind of reflection) Is it possible to set a local … Read more