函数介绍
msgbox()——消息弹窗
msgbox(msg=’ ‘, title=’ ‘, ok_button=’ ', image=None, root=None)
该函数一般调用前三个关键字即可,加载图片的话给image赋值需要下载其他库,否则只能加载GIF。
ccbox()——双项选择
ccbox(msg=’ ‘, title=’ ‘, choices=(’ ', ’ '), image=None)
多了一个选项为choices(只能容纳两个选项!)
其返回值为布尔值Ture或者False.
buttombox()——多项选择
buttonbox(msg=’ ‘, title=’ ', choices=(‘Button1’, ‘Button2’, ‘Button3’), image=None, root=None)
该函数和ccbox()不一样,其返回值为button的对应文本字符。
choicebox()、multchoicebox()——可选的下拉列表
choicebox(msg=’ ‘, title=’ ', choices=())
选项输入不再是单个元素,此处是以整个序列的方式输入,如列表、元组等;
选择选项后确认,会返回选项内容的文本内容,否则是none
multchoicebox()功能同样,只是他可以提供多选,多选的返回值是多选的文本列表
enterbox()——文本输入框
enterbox(msg=’ ‘, title=’ ‘, default=’ ', strip=True, image=None, root=None)
其中,default关键字定义的是文本框默认值,strip的值为True时会自动忽略输入的首尾空格,False则相反;
返回值为输入的字符串;
interbox()——文本输入框
integerbox(msg=’’, title=’ ‘, default=’’, lowerbound=0, upperbound=99, image=None, root=None, **invalidKeywordArgument