import ast
# Simple code that sets a variable var to 1 and then prints it.
code = """
var = 1
print(var)
"""
# Converts code to AST. Object 'head' points to the head of the AST.
head = ast.parse(code)
print(head)
from Hacker News https://ift.tt/3vRNw1d
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.