Last active
September 6, 2017 08:56
-
-
Save themoah/c8ecf46ba015f486950dc51e4f09c1df to your computer and use it in GitHub Desktop.
python3 gist
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
if __name__ == '__main__': | |
main(sys.argv[1]) # The 0th arg is the module filename | |
if __name__ == '__main__': | |
unittest.main() | |
#!/usr/bin/env python3 | |
Use __name__ to determine how the module is being used | |
If __name__ == "__main__" the module is being executed Module code is executed exactly once, on rst import | |
def is a statement which binds a function de nition to a name | |
Command line arguments are accessible through sys.argv | |
The script lename is in sys.argv[0] | |
Tuple - immutable sequance. | |
t = ("Norway" , 4.95, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment