You can use ast.parse
to turn source code into a abstract syntax tree. Is there a way to do the opposite - turn an abstract syntax tree into the source code it was generated from?
Asked
Active
Viewed 134 times
0

rlms
- 10,650
- 8
- 44
- 61
-
It seems that all aspects of your questions are adequately addressed in http://stackoverflow.com/questions/768634/parse-a-py-file-read-the-ast-modify-it-then-write-back-the-modified-source-c? – NPE Dec 28 '14 at 19:14
-
@NPE Yeah, they seem the same. – rlms Dec 28 '14 at 19:19