Created
June 22, 2016 12:48
-
-
Save androm3da/dd257031eeaf3ff09d6654726a63f93f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python3 once.py | |
Module(body=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Str(s='foo')], keywords=[], starargs=None, kwargs=None))]) | |
$ python3 --version | |
Python 3.4.3+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python once.py | |
Module(body=[Print(dest=None, values=[Str(s='foo')], nl=True)]) | |
$ python --version | |
Python 2.7.10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import ast | |
text = '''print('foo') | |
''' | |
node = ast.parse(text) | |
print(ast.dump(node)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment