Skip to content

Instantly share code, notes, and snippets.

@josePhoenix
Created October 2, 2014 19:08
Show Gist options
  • Select an option

  • Save josePhoenix/ca9ab6edfe3aa880a4c9 to your computer and use it in GitHub Desktop.

Select an option

Save josePhoenix/ca9ab6edfe3aa880a4c9 to your computer and use it in GitHub Desktop.
def do_a_thing(filename):
print "Filename was", filename
if __name__ == "__main__":
import sys
do_a_thing(sys.argv[1])
# $ python ~/example.py foo.bar
# Filename was foo.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment