Created
March 18, 2015 19:48
-
-
Save SegFaultAX/c68f74cb7b14b800bfb0 to your computer and use it in GitHub Desktop.
argparse example
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
import argparse | |
def main(): | |
parser = argparse.ArgumentParser("Do a thing with stuff!") | |
parser.add_argument("number", type=int) | |
args = parser.parse_args() | |
print "nan" * args.number + " batman!" | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment