Skip to content

Instantly share code, notes, and snippets.

@efazati
Created June 30, 2015 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save efazati/ffaf367832c346c4d69e to your computer and use it in GitHub Desktop.
Save efazati/ffaf367832c346c4d69e to your computer and use it in GitHub Desktop.
OptionParser
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