Created
June 30, 2015 08:22
-
-
Save efazati/ffaf367832c346c4d69e to your computer and use it in GitHub Desktop.
OptionParser
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
from optparse import OptionParser | |
import time | |
def fn1(): | |
print 'test' | |
if __name__ == '__main__': | |
parser = OptionParser() | |
parser.add_option("-d", "--fn1", dest="fn1") | |
(options, args) = parser.parse_args() | |
fn1_func = options.fn1 | |
if fn1_func: | |
fn1() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment