aboutsummaryrefslogtreecommitdiffstats
path: root/executor.py
blob: 713412b4508cf3c107cabbf93f58c4b569d96fcb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import sys
import ast


def main():
    code = sys.argv[1]
    tree = ast.parse(code)
    fake_interactive_tree = ast.Interactive()
    fake_interactive_tree.body = tree.body
    exec(compile(fake_interactive_tree, "<input>", "single"), {}, {})

main()