Skip to content

Instantly share code, notes, and snippets.

@syfun
Created August 19, 2018 01:40
Show Gist options
  • Save syfun/5984c6edb2eb0d5c2b5024c8e519ef1c to your computer and use it in GitHub Desktop.
Save syfun/5984c6edb2eb0d5c2b5024c8e519ef1c to your computer and use it in GitHub Desktop.
python exec
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