Created
September 3, 2010 18:12
-
-
Save neilkod/564299 to your computer and use it in GitHub Desktop.
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 | |
""" prints hello followed by the value of the first command-line parameter """ | |
import sys | |
try: | |
print "hello %s" % sys.argv[1] | |
except IndexError: | |
print "usage: parameter.py name" | |
MacBookPro:commonTweeps nkodner$ ./parameter.py | |
usage: parameter.py name | |
MacBookPro:commonTweeps nkodner$ ./parameter.py neil | |
hello neil | |
MacBookPro:commonTweeps nkodner$ | |
built for @andturntwo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment