Created
July 7, 2023 14:13
-
-
Save tdsmith/0a752d0080bd07e8ba9e66e37adad880 to your computer and use it in GitHub Desktop.
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
import sys | |
print(__name__) | |
main = sys.modules["__main__"] | |
x = dir(main) | |
print(x) | |
print(f"the secret is {getattr(main, 'MY_SECRET')}") |
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
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