Created
July 21, 2012 17:26
-
-
Save sigmavirus24/3156487 to your computer and use it in GitHub Desktop.
Example for ninjax1 (DO NOT UPDATE FURTHER. USED TO TEST GITHUB3.PY)
This file contains 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/env python | |
import sys | |
' '.join(sys.argv) |
This file contains 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/env python | |
import sys | |
def create_dict(username, pin): | |
return {username: pin} | |
# ideally, this should be executed as: | |
# ~$ script.py username pin | |
# if you omit one of the arguments, you will get an exception below | |
script, username, pin = argv[:3] | |
# To avoid getting that exception you could do something like: | |
#if len(argv) < 3: | |
# print "Expected 3 or more arguments, received only {0}".format(len(argv)) | |
# sys.exit(1) | |
index = {} | |
index.update(create_dict(username, int(pin))) | |
print "{0} made {1}".format(script, str(index)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Comment to ensure it has a comment