EasyGui的一个小例子

  EasyGui的安装:首先下载easyGui安装包,地址链接:https://pan.baidu.com/s/1D8f_eXWn7l8xhcTuEsqZmA 密码:e5z5

  安装步骤:

  1.进入easygui目录下,
  2.windows如果已经配置好python的环境变量,那么直接打开控制窗口写python setup.py install

import easygui as gui
import sys

while 1:
    gui.msgbox('嗨,欢迎进入第一个界面小游戏o∩_∩o ')
    msg='请问你喜欢吃什么水果?'
    title="小游戏互动"
    choices = ["苹果","桃子","葡萄","香蕉"]
    choice = gui.choicebox(msg,title,choices)
    gui.msgbox("你选择的是:"+str(choice),"结果")
    msg="你希望重新开始小游戏么"
    title="请选择"
    if gui.ccbox(msg,title):
        pass
    else:
        sys.exit(0)

原文地址:https://www.cnblogs.com/pengpengzhang/p/8688497.html