easygui适合用于python的一些简单的图形开发
官网:http://easygui.sourceforge.net
安装:
pip3 install easygui(mac)
导入:
import easygui
导入成功后可以调用验证下,调用msgbox()会有弹窗
基本函数介绍:
1. easygui.ynbox(msg,choices,image):输出的内容默认为Shall I continue? ,msg可以设置输入,结果可选择yes or no或者设置按钮
2.easygui.msgbox(msg,title,ok_button):显示消息内容msg和ok按钮,可自定义标题和消息以及ok的按钮名。
3.easygui.ccbox(msg,title,choices,image):提供选择continue或cancel,返回1或者0
4.easygui.boolbox(msg,title,choices,image):展示布尔值的消息框,默认选项yes or no
5.easygui.indexbox(msg,title,choices):用户选择第一个按钮返回1,第二个按钮返回0
6.easygui.buttonbox(msg,title,choice=('Button[1]','Button[2]','Button[3]'),image):可设置多个按钮
7.easygui.integerbox(msg,title,lowerbound=0,upperbound=99):提供简单输入框,只能输入0-99,lowerbound和upperbound可设置,只能输入整数,否则会要求重新输入
8.easygui.multenterbox(msg,title,fields=(),values=()):提供多个输入框