run.py 611 B

1234567891011121314151617181920
  1. from argparse import ArgumentParser
  2. def gui_parser():
  3. parser = ArgumentParser(description="Run the GUI")
  4. parser.add_argument("-host", type=str, default="0.0.0.0", help="hostname")
  5. parser.add_argument("-port", type=int, default=8080, help="port")
  6. parser.add_argument("-debug", action="store_true", help="debug mode")
  7. return parser
  8. def run_gui_args(args):
  9. from g4f.gui import run_gui
  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)