Skip to content

Instantly share code, notes, and snippets.

@belsander
Created December 17, 2016 13:47
Show Gist options
  • Save belsander/4c7d523d39a8bbdc191ece11dcfa6b17 to your computer and use it in GitHub Desktop.
Save belsander/4c7d523d39a8bbdc191ece11dcfa6b17 to your computer and use it in GitHub Desktop.
# Code below behaves the same as eval()
eval(compile(str_source_code, “<string>”, “eval”))
# Code below behaves the same as exec()
exec(compile(str_source_code, “<string>”, “exec”))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment