aboutsummaryrefslogtreecommitdiffstats
path: root/executor.py
diff options
context:
space:
mode:
Diffstat (limited to 'executor.py')
-rw-r--r--executor.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/executor.py b/executor.py
new file mode 100644
index 0000000..713412b
--- /dev/null
+++ b/executor.py
@@ -0,0 +1,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() \ No newline at end of file