Skip to content

Instantly share code, notes, and snippets.

@FrankFonts
Created April 22, 2015 11:34
Show Gist options
  • Save FrankFonts/887d1b23541ae8c0887f to your computer and use it in GitHub Desktop.
Save FrankFonts/887d1b23541ae8c0887f to your computer and use it in GitHub Desktop.
Command Line Arguments
#!/usr/bin/python
import sys
# it's easy to print this list of course:
print sys.argv
# or it can be iterated via a for loop:
for i in range(len(sys.argv)):
if i == 0:
print "Function name: %s" % sys.argv[0]
else:
print "%d. argument: %s" % (i,sys.argv[i])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment