Skip to content

Instantly share code, notes, and snippets.

@tdsmith
Created July 7, 2023 14:13
Show Gist options
  • Save tdsmith/0a752d0080bd07e8ba9e66e37adad880 to your computer and use it in GitHub Desktop.
Save tdsmith/0a752d0080bd07e8ba9e66e37adad880 to your computer and use it in GitHub Desktop.
import sys
print(__name__)
main = sys.modules["__main__"]
x = dir(main)
print(x)
print(f"the secret is {getattr(main, 'MY_SECRET')}")
MY_SECRET = "cheese"
print(__name__)
import import_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment