You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6 KiB

  1. '''
  2. Created on Dec 21, 2013
  3. @author: Chris
  4. '''
  5. import sys
  6. import hashlib
  7. from time import time as _time
  8. from time import sleep as _sleep
  9. from gooey import Gooey
  10. from gooey import GooeyParser
  11. def main():
  12. desc = "Example application to show Gooey's various widgets"
  13. my_cool_parser = GooeyParser(description=desc)
  14. my_cool_parser.add_argument("Example", help="fill ", widget="FileChooser") # positional
  15. verbosity = my_cool_parser.add_mutually_exclusive_group()
  16. verbosity.add_argument('-t', '--verbozze', dest='verbose', action="store_true", help="Show more details")
  17. verbosity.add_argument('-q', '--quiet', dest='quiet', action="store_true", help="Only output on error")
  18. print my_cool_parser._actions
  19. print 'inside of main(), my_cool_parser =', my_cool_parser
  20. args = my_cool_parser.parse_args()
  21. print sys.argv
  22. print args.countdown
  23. print args.showtime
  24. start_time = _time()
  25. print 'Counting down from %s' % args.countdown
  26. while _time() - start_time < args.countdown:
  27. if args.showtime:
  28. print 'printing message at: %s' % _time()
  29. else:
  30. print 'printing message at: %s' % hashlib.md5(str(_time())).hexdigest()
  31. _sleep(.5)
  32. print 'Finished running the program. Byeeeeesss!'
  33. def here_is_smore():
  34. pass
  35. if __name__ == '__main__':
  36. print sys.argv
  37. main()
  38. # import inspect
  39. # import dis
  40. # # print dir(main.__code__)
  41. # # for i in dir(main.__code__):
  42. # # print i, getattr(main.__code__, i)
  43. # print dis.dis(main.__code__)
  44. # # for i in inspect.getmembers(main):
  45. # # print i