Skip to content

Instantly share code, notes, and snippets.

@tdsmith
Created July 7, 2023 14:13
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