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.

55 lines
1.6 KiB

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