Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. parser_class1.py
  2.  
  3. parser_class2.py
  4.  
  5. parser_class3.py
  6.  
  7. mmain.py -p parser_class1
  8.  
  9. #!/usr/bin/env python
  10.  
  11. import argparse
  12. aparser = argparse.ArgumentParser()
  13. aparser.add_argument('-p',
  14. action='store',
  15. dest='module',
  16. help='-i module to import')
  17. results = aparser.parse_args()
  18.  
  19. if not results.module:
  20. aparser.error('Error! no module')
  21. try:
  22. exec("import %s" %(results.module))
  23. print '%s imported done!'%(results.module)
  24. except ImportError, e:
  25. print e
  26.  
  27. username = secret_username
  28. password = never_share
  29.  
  30. mmain.py -p 'parser_class1;print globals()'
  31.  
  32. exec("import %s" %('parser_class1;print globals()'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement