python安装easygui

python的第三方简单图形界面的GUI类库下载easygui-0.97.zip

官网下载:http://nchc.dl.sourceforge.net/project/easygui/0.97/easygui-0.97.zip
[https://sourceforge.net/projects/easygui/?source=navbar]

安装:解压后将easygui.py拷贝进Python安装目录下的Lib\site-packages文件夹下

测试小例子:

import easygui

# 第二种导入方式
##from easygui import *
##msgbox(...)

# 第三种导入方式
##import easygui as g
##g.msgbox(...)

easygui.msgbox("hello,world!")

fruit = easygui.enterbox("What is your favorite fruit?")
easygui.msgbox("You entered:" + fruit)

fruit = easygui.buttonbox("What is your favorite fruit?", choices = ['banana', 'peach', 'apple', 'pear'])
easygui.msgbox("You entered:" + fruit)

msg ="What is your favorite flavor?"
title = "Ice Cream Survey"
choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"]
choice = easygui.choicebox(msg, title, choices)

你可能感兴趣的:(python)