当前位置: 首页 > 后端技术 > Python

python-Gooey快速GUI程序

时间:2023-03-25 19:57:02 Python

1.安装需要的库pipinstallGooey2。导入需要的库fromgooeyimportGooey,GooeyParser3.代码部分@Gooey(richtext_controls=True,language='chinese',header_show_title=False,program_name="processingtoolv1.0",encoding="utf-8",default_size=(650,555),progress_expr="current/total*100",#再次执行,清除之前执行的日志clear_before_run=True,timing_options={'show_time_remaining':True,'hide_time_remaining_on_complete':False})defmain():desc="工具说明:"+"\n"+""+"1.本工具仅作为xxx使用"file_help_msg="help...info"my_cool_parser=GooeyParser(description=desc)my_cool_parser.add_argument(option_strings=['-u','--username'],dest='account',widget="TextField")my_cool_parser.add_argument(option_strings=['-p','--password'],dest='password',widget="TextField")my_cool_parser.add_argument(option_strings=['-v','--verify_number'],dest='验证码',widget="TextField")my_cool_parser.add_argument(option_strings=['-f','--file_path'],dest="要匹配的文件路径",widget="FileChooser")#获取参数args=my_cool_parser.parse_args()print(args)defhere_is_more():pass5.Demo