Last active
August 29, 2015 14:21
-
-
Save sebleblanc/8540408cab6b30d098b8 to your computer and use it in GitHub Desktop.
Convert a Python script to a module
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 print_a(a=1): | |
print("The value of a is", a) | |
print("Done!") |
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
# Here I am | |
import the_module | |
if __name__ == "__main__": | |
the_module.print_a(a=5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment