1.msgbox:
語法:msgbox(text,title, ok_button='OK',image=None,root=None)
實例:msgbox('內容內容','標題標題','確定')返回值是按鈕的text屬性
2.ccbox:
語法:ccbox(text,title, choices=('Continue','Cancel'),image=None)按鈕默認值是Continue和Cancel
實例:g.ccbox('內容內容','標題標題',('繼續','取消'))返回值(1,0)
3.ynbox:
語法:ynbox(text,title, choices=('Yes','No'),image=None)按鈕默認值是Yes和No
實例:ynbox('內容內容','考題標題',('是','否'))返回值(1,0)
4.bottonbox:定義一組按鈕
語法:buttonbox(text,title, choices=('Btn1','Btn2','Btn3'),image=None,root=None)
choices是一個元組對象,里面是按鈕的集合
實例:buttonbox('大家說我長得帥嗎?', image='turtle.gif', choices=('帥', '不帥', '!@#$%'))buttonbox的圖片只支持gif格式
5.indexbox:
語法:indexbox(text,title, choices=('Yes','No'),image=None)返回值(0,1)
6.boolbox:同ynbox語法相同
7.choicebox:單選
語法:choicebox(text,title, choices=())choices可以是一個元祖或者列表,返回值為選中的項的值
8.multchoicebox:多選
語法:同choicebox相同,返回被選項組成的一個列表.
9.enterbox:
語法:enterbox(text,title,default='',Strip=True,image=None,root=None)Strip=True默認消除輸入內容前后空格返回輸入的字符串.
實例:enterbox('請輸入內容','標題')
10.integerbox:
語法:integerbox(text,title,lowerbound=0,upperbound=99,image=None,root=None,**InvalidKeywordArguments)lower和upper現在用戶輸入的下限和上限值
11.multenterbox:
語法:multenterbox(text,title,fields=(),values=())values是輸入框的默認值元祖,返回輸入信息的組成的一個列表
實例:multenterbox('A項目\nB項目\nC項目\nD項目','測試多項輸入框',('A項目','B項目','C項目','D項目'),('小甲魚',))----['小甲魚', '小魷魚', '大水魚', '嘿嘿']
12.passwordbox:
語法:passwordbox(text,title,default='',image=None,root=None)
實例:passwordbox('請輸入密碼:')
13.multpasswordbox:
語法:multpasswordbox(text,title,fields=(),values=())
實例:multpasswordbox('請輸入用戶名和密碼:','系統登錄',('用戶名:','密 碼:'),('admin',))
14.textbox:
語法:textbox(msgtext,title,text='',codebox=0)顯示文本內容會自動換行,第三個參數可以是字符串,列表,元祖類型
實例:f=open('record.txt');textbox('內容顯示:','打開文本',f)
15.codebox:
語法:codebox(msgtext,title,text='')實際上等於textbox(codebox=1)
16.diropenbox:目錄瀏覽,返回所選目錄字符串
語法:diropenbox(msg=None,title=None,defualt=None)
17.fileopenbox:打開文件對話框,返回文件絕對路徑字符串
語法:fileopenbox(msg=None,title=None,defualt='*',filetype=None)
filetype可是字符串列表:filetype=["*.txt"] 或者 filetype=["*.css",["*.htm","*.html"."HTML files"]]
18.filesavebox:
語法:filesavebox(msg=None,title=None,defualt='*',filetype=None)
19.EgStore:
20.exceptionbox:異常捕獲
try:
int('Fish')
except:
g.exceptionbox()