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.

32 lines
794 B

  1. import time
  2. from gooey import Gooey
  3. from gooey import GooeyParser
  4. @Gooey(
  5. sidebar_title="Your Custom Title",
  6. show_sidebar=True,
  7. show_success_modal=False,
  8. force_stop_is_error=False,
  9. )
  10. def main():
  11. parser = get_parser()
  12. args = parser.parse_args()
  13. time.sleep(2)
  14. print("Success")
  15. def get_parser():
  16. """
  17. A simple parser with a single required argument and no default thus
  18. ensuring that clicking the start button in the UI will throw
  19. a validation error.
  20. """
  21. desc = "Example application to show Gooey's various widgets"
  22. parser = GooeyParser(description=desc, add_help=False)
  23. parser.add_argument('--textfield', widget="TextField", required=True)
  24. return parser
  25. if __name__ == '__main__':
  26. main()