Skip to content

Instantly share code, notes, and snippets.

@sigmavirus24
Created July 21, 2012 17:26
Show Gist options
  • Save sigmavirus24/3156487 to your computer and use it in GitHub Desktop.
Save sigmavirus24/3156487 to your computer and use it in GitHub Desktop.
Example for ninjax1 (DO NOT UPDATE FURTHER. USED TO TEST GITHUB3.PY)
#!/usr/bin/env python
import sys
' '.join(sys.argv)
#!/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))
@sigmavirus24
Copy link
Author

Comment to ensure it has a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment