|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
图形用户界面编程,GUI(Graphical User Interface)编程,那些带有按钮、文本、输入框的窗口的编程。
EasyGui官网:
http://easygui.sourceforge.net
安装完easygui后,需要导入模块,三种导入方法
>>> import easygui
>>> easygui.msgbox('hi,how are you')
'OK'
>>> from easygui import *
>>> msgbox('hi, beauty')
'OK'
>>> import easygui as g 可以保持easygui的命名空间和减少打字数量
>>> g.msgbox('hallo,wie geht es dir')
'OK'
例子:
from easygui import *
import sys
while 1:
msgbox("Hello, world!")
msg ="What is your favorite flavor?"
title = "Ice Cream Survey"
choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"]
choice = choicebox(msg, title, choices)
# note that we convert choice to string, in case
# the user cancelled the choice, and we got None.
msgbox("You chose: " + str(choice), "Survey Result")
msg = "Do you want to continue?"
title = "Please Confirm"
if ccbox(msg, title): # show a Continue/Cancel dialog
pass # user chose Continue
else:
sys.exit(0) # user chose Cancel
|
评分
-
查看全部评分
|