Created
January 15, 2015 22:20
-
-
Save skuschel/a38ad4ebb89a207a8ea2 to your computer and use it in GitHub Desktop.
Argparse demo
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 python2 | |
# argparse demo with multiple arguments. Try the following | |
# python2 argparsedemo.py xx yy --optional 5 6 7 | |
if __name__ == '__main__': | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('werte', nargs=2) | |
parser.add_argument('--optional', nargs=3, default=[1, 2, 3]) | |
args = parser.parse_args() | |
print args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment