Created
April 14, 2016 14:55
-
-
Save ymcdull/abeee177a9f5deaea094dd42bd471499 to your computer and use it in GitHub Desktop.
Test optparser example
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
### optparser has been discarded since python2.7, try argparse instead | |
### Url: http://lingxiankong.github.io/blog/2014/01/14/command-line-parser/ | |
from optparser import OptionParser | |
parser = OptionParser() | |
parser.add_option('-f', '--file', dest="filename", help="write report to FILE", metavar="FILE") | |
options, args = parser.parse_args() | |
print options, args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment