-
-
Save baojie/83c62a0a8145d849cc86 to your computer and use it in GitHub Desktop.
Test whether statements in a module will just run once under multiple imports
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
print "run a from", __file__ |
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 a |
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 a | |
import b | |
import a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ python c.py
run a from /tmp/test/a.pyc