Skip to content

Instantly share code, notes, and snippets.

@riywo
Created February 26, 2013 02:28
Show Gist options
  • Save riywo/5035308 to your computer and use it in GitHub Desktop.
Save riywo/5035308 to your computer and use it in GitHub Desktop.
#!/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()
@riywo
Copy link
Author

riywo commented Feb 26, 2013

勉強になります!ありがとうございます!!!

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