Created
April 22, 2015 11:34
-
-
Save FrankFonts/887d1b23541ae8c0887f to your computer and use it in GitHub Desktop.
Command Line Arguments
This file contains hidden or 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
#!/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