既然之前寫彈窗程序用到了Easygui, 就在這簡單說明一下.
Easygui是一個Python用於簡單開發GUI的類庫, 很適合新手寫簡單的圖形界面
EasyGui是基於TKinter的,所以可以跨平台使用。使用方法很簡單,下載之后解壓把easygui.py放到python安裝目錄下的lib/site-packages/下面即可
下載鏈接:http://pan.baidu.com/share/link?shareid=1629272171&uk=3961254249 密碼:cmcz
官方地址:http://easygui.sourceforge.net/
1.EasyGui msgbox
消息窗口. 實現代碼:
import easygui easygui.msgbox("Hello, world!")
2.EasyGui enterbox
輸入窗口。
import easygui flavor = easygui.enterbox("What is your favorite ice cream flavor?")
easygui.msgbox ("You entered " + flavor)
3.Easygui buttonbox
選項窗口
import easygui flavor = easygui.buttonbox("What is your favorite ice cream flavor?",choices = ['Vanilla', 'Chocolate', 'Strawberry'] ) easygui.msgbox ("You picked " + flavor)