Last active
January 31, 2017 11:02
-
-
Save craiga/cda39dcf42357192dbda7d6238d446db to your computer and use it in GitHub Desktop.
Do Python modules load once and only once?
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
def main(): | |
print("Importing tell the time module") | |
import tell_the_time | |
print("Importing tell the time module again") | |
import tell_the_time as tell_the_time_again | |
if __name__ == '__main__': | |
main() |
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
from datetime import datetime | |
print(datetime.now()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like modules are only imported once.