鱼C论坛

 找回密码
 立即注册
查看: 1897|回复: 0

[技术交流] python入门L35EasyGui

[复制链接]
发表于 2017-7-23 19:23:04 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

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

评分

参与人数 1鱼币 +1 收起 理由
小甲鱼 + 1

查看全部评分

本帖被以下淘专辑推荐:

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-28 18:01

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表