python easygui模块的使用
复习回顾
- 列表的遍历
- 字典的查询
- urllib模块的使用
- json模块的使用
本节新知
- easygui之msgbox
返回值为按钮内容
1
| eg.msgbox(msg="消息内容",title="标题",ok_button="按钮名字")
|
- easygui之choicebox
choicebox的选项必须是多个,返回值为按钮内容
1
| eg.choicebox(msg="消息内容",title="标题",choices=("选项一","选项二"))
|
- easygui之ccbox和boolbox和ynbox
返回值为布尔值,即真或假
1 2 3
| import easygui as eg eg.ccbox("msg_content", "title") eg.boolbox("msg_content", "title", ("1", "2"))
|
- easygui之indexbox
indexbox的选项可以有多个,并且返回值为该选项对应的索引
1 2
| import easygui as eg eg.indexbox("msg", "title", ("first", "second", "third", "forth"))
|
- easygui之buttonbox
buttonbox的按钮可以为多个,返回值为按钮的名字
1
| eg.buttonbox(msg="消息内容",title="标题",choices=("选项一","选项二"))
|
- easygui之enterbox
普通输入框,可添加初始值,返回值为输入的文本信息
1
| print(eg.enterbox(msg="消息内容",title="标题")
|
- easygui之textbox
文本输入框,适合输入大段文字,返回值为输入的文本信息
- easygui之integerbox
数字输入框,默认可输入范围为0-99,返回值为输入数字
1 2
| import easygui as eg eg.integerbox("msg_content", "title", lowerbound=1, upperbound=200)
|
- eaygui之multenterbox
多输入框
1 2
| import easygui as eg eg.integerbox("msg_content", "title", ("name", "age", "height", "weight"))
|
- easygui之passwordbox
1
| print(eg.passwordbox(msg="请输入您的密码"))
|
- easygui之multpasswordbox
1 2
| import easygui as eg eg.multpasswordbox
|
- easygui之egdemo
通过easygui中的egdemo函数可以调用easygui模块自带的demo,可查看包含的所有功能
1 2
| import easygui as eg eg.egdemo()
|
保存文件选择路径
显示图片
课后作业
使用easygui设计一个图书馆后台登录及管理系统