Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- parser_class1.py
- parser_class2.py
- parser_class3.py
- mmain.py -p parser_class1
- #!/usr/bin/env python
- import argparse
- aparser = argparse.ArgumentParser()
- aparser.add_argument('-p',
- action='store',
- dest='module',
- help='-i module to import')
- results = aparser.parse_args()
- if not results.module:
- aparser.error('Error! no module')
- try:
- exec("import %s" %(results.module))
- print '%s imported done!'%(results.module)
- except ImportError, e:
- print e
- username = secret_username
- password = never_share
- mmain.py -p 'parser_class1;print globals()'
- exec("import %s" %('parser_class1;print globals()'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement