国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

Python 模塊EasyGui詳細介紹

2020-02-23 04:23:18
字體:
來源:轉載
供稿:網友

Python 模塊EasyGui詳細介紹

前言:

在Windows想用Python開發一些簡單的界面,所以找到了很容易上手的EasyGui庫。下面就分享一下簡單的使用吧。

參考的鏈接:官網Tutorial

接下來,我將從簡單,到復雜一點點的演示如何使用這個模塊。希望能給剛接觸easygui的你一點幫助 :-)

msgBox,ccbox,ynbox

# coding:utf-8#  __author__ = 'Mark sinoberg'#  __date__ = '2016/5/25'#  __Desc__ = 一個最簡單的類似于Java的MessageBox的小窗口import easyguititle = easygui.msgbox(msg='提示信息',title='標題部分',ok_button="OOK")msg = easygui.msgbox('Hello Easy GUI')print '返回值:' + msgccbox = easygui.ccbox("here is Continue | Cancel Box!")print '返回值:' + str(ccbox)ynbox = easygui.ynbox("Yes Or No Button Box!")print '返回值: ' + str(ynbox)

bottonbox

# coding:utf-8#  __author__ = 'Mark sinoberg'#  __date__ = '2016/5/25'#  __Desc__ = 能讓你最初選擇的簡單的界面,第二個參數為一個列表import easygui# choice = easygui.buttonbox("這里是提示的語句信息:/n", title='三選一', choices=['one' /#   , 'two', 'three'])# easygui.msgbox('您選擇了:' + str(choice))## # choices 內只能有兩個參數 ,選擇哪一個將返回1,否則返回0# bool = easygui.boolbox('msg提示信息', title='標題部分', choices=['A', 'B'])# easygui.msgbox(bool)image = 'me.jpg'msg = 'Here is my photo,a python fan also'choices = ['Yes','No',"Not Sure"]title = 'Am I handsome?'easygui.buttonbox(msg,title,image=image,choices=choices)

choicebox

# coding:utf-8#  __author__ = 'Mark sinoberg'#  __date__ = '2016/5/25'#  __Desc__ = 從一個列表中選擇其中的一個,會有返回值的出現import easyguimsg = '選擇此列表項中你喜歡的一個吧'title = '必須選擇一個哦'choices = ['1','2','3','4','5','6','7']answer = easygui.choicebox(msg,title,choices)print '你選擇了 :' + str(answer)

enterbox

# coding:utf-8#  __author__ = 'Mark sinoberg'#  __date__ = '2016/5/25'#  __Desc__ = 可以滿足用戶輸入的控件import easyguist = easygui.enterbox("請輸入一段文字:/n")print "您輸入了: " + str(st)

mutilchoicebox

# coding:utf-8#  __author__ = 'Mark sinoberg'#  __date__ = '2016/5/25'#  __Desc__ = 一個多選的列表項.呵呵了,這個版本貌似有問題。我的多選并沒有真正的實現import easyguimsg = '選擇此列表項中你喜歡的一個吧'title = '必須選擇一個哦'choices = (1,2,3,4,5,6,7,8,9)answer1 = easygui.multchoicebox(msg,title,choices)for item in answer1:  print item

intenterbox,passenterbox

# coding:utf-8#  __author__ = 'Mark sinoberg'#  __date__ = '2016/5/25'#  __Desc__ = 提供給用戶簡單的輸入框,只能是給定的數字的范圍import easyguimsg = '請輸入一個數字,范圍在0-100'title = '限制為數字類型'lowerbound = 0upperbound = 100default = ''image = 'me.jpg'result = easygui.integerbox(msg,title,default,lowerbound,upperbound,image)print result            
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 河间市| 丁青县| 扎兰屯市| 松潘县| 那曲县| 定州市| 耿马| 桂东县| 长泰县| 镇安县| 红安县| 宿松县| 宜君县| 朝阳区| 长海县| 青阳县| 庆云县| 泰和县| 凌海市| 安仁县| 芦山县| 永春县| 鞍山市| 新郑市| 昌黎县| 冷水江市| 湘潭市| 沙河市| 逊克县| 洪雅县| 台中县| 浑源县| 汤原县| 石景山区| 会昌县| 泰顺县| 津南区| 九台市| 南充市| 宝应县| 商南县|