Created
November 4, 2020 06:47
-
-
Save whal-e3/86133a0d2bbdd619be06703487219127 to your computer and use it in GitHub Desktop.
Python import + if __name__ == "__main__":
This file contains hidden or 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
| # sand box 1 file ------------------------------------------------------------------- | |
| import SandBox2 | |
| if __name__ == "__main__": | |
| print("Executed when invoked directly from SANDBOX 1") | |
| else: | |
| print("Executed when imported from SANDBOX 1") | |
| # sand box 2 file ------------------------------------------------------------------- | |
| if __name__ == "__main__": | |
| print("Executed when invoked directly 2 from SANDBOX 2") | |
| else: | |
| print("Executed when imported from SANDBOX 2") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment