run.py 612 B

12345678910111213141516171819202122232425
  1. from argparse import ArgumentParser
  2. from g4f.gui import run_gui
  3. def gui_parser():
  4. parser = ArgumentParser(description="Run the GUI")
  5. parser.add_argument("-host", type=str, default="0.0.0.0", help="hostname")
  6. parser.add_argument("-port", type=int, default=8080, help="port")
  7. parser.add_argument("-debug", action="store_true", help="debug mode")
  8. return parser
  9. def run_gui_args(args):
  10. host = args.host
  11. port = args.port
  12. debug = args.debug
  13. run_gui(host, port, debug)
  14. if __name__ == "__main__":
  15. parser = gui_parser()
  16. args = parser.parse_args()
  17. run_gui_args(args)