Created
August 19, 2018 01:40
-
-
Save syfun/5984c6edb2eb0d5c2b5024c8e519ef1c to your computer and use it in GitHub Desktop.
python exec
This file contains 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
script = """ | |
a = 2 | |
global d | |
d = { | |
"a": a | |
} | |
""" | |
def test(): | |
exec(script) | |
print(d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment