Skip to content

Instantly share code, notes, and snippets.

@sjparkinson
Last active April 11, 2017 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjparkinson/9fa7b17ebee79e8169bb7979e13c9b75 to your computer and use it in GitHub Desktop.
Save sjparkinson/9fa7b17ebee79e8169bb7979e13c9b75 to your computer and use it in GitHub Desktop.
Code club on debugging with Python PDB.
#!/usr/bin/python
# import modules used here -- sys is a very standard one
import sys
# Gather our code in a main() function
def main():
print 'Hello there', sys.argv[1] if len(sys.argv) > 1 else 'Anon'
# Command line args are in sys.argv[1], sys.argv[2] ..
# sys.argv[0] is the script name itself and can be ignored
# Standard boilerplate to call the main() function to begin
# the program.
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment