Is there a way to convert a given Python abstract syntax tree (AST) to a source code?
Here is a good example of how to use Python's ast
module, specifically a NodeTransformer
. I was looking for a way to convert the resulting AST back to source, so the changes can be inspected visually.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…