From: Frank W. <fwi...@gm...> - 2009-12-30 20:10:32
|
On Wed, Dec 30, 2009 at 2:59 PM, Philip Cannata <Phi...@su...> wrote: > Thanks Franke, but if I do the following: > $ cat testAstView.py; ./dist/bin/jython ast/astview.py testAstView.py > a=111 > b=222 > x=a+b Not sure exactly what you are looking for. To get x with a value of 333 you really have to run the program, since from an AST perspective the "x" is a name and doesn't have a value until runtime. If you are looking for runtime values - you can always use locals() >>> a = 111 >>> b = 222 >>> x = a + b >>> locals() {'b': 222, '__doc__': None, 'a': 111, '__name__': '__main__', 'x': 333} -Frank |