Created
February 26, 2013 02:28
-
-
Save riywo/5035308 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
from optparse import OptionParser | |
class Hoge(object): | |
def __init__(self): | |
parser = OptionParser() | |
parser.add_option("-f", "--foo", action="store_true", dest="foo", default=False, | |
help="Foo") | |
(self.options, self.args) = parser.parse_args() | |
def run(self): | |
print self.options | |
print self.args | |
if __name__ == "__main__": | |
hoge = Hoge() | |
hoge.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
勉強になります!ありがとうございます!!!