easygui的使用

import easygui as g
import sys
import random

list1 = ['用户名:', '登入密码:']
while 1:
    g.msgbox("嗨,欢迎进入第一个界面小游戏^_^", "小游戏")
    g.multenterbox('请登入用户界面', '登入', fields=((list1)))
    msg = "请问你希望在我这里学习到什么知识呢?"
    title = "小游戏互动"
    choices = ["谈恋爱经验", "编程大大的", "OOXX", "琴棋书画nb哦"]

    choice = g.choicebox(msg, title, choices)

    # note that we convert choice to string, in case
    # the user cancelled the choice, and we got None.
    g.msgbox("你的选择是: " + str(choice), "结果")
    g.msgbox('恭喜你,你很有前途啊,马上就要尽得老夫真传')
    # 猜数字小游戏
    secret = random.randint(1, 10)
    g.enterbox(msg='最帅的人是我吗?',
               title='----------tangc实验室-----------',
               default=' '

               )

    msg = "你希望重新开始小游戏吗?"
    title = "请选择"

    if g.ccbox(msg, title):  # show a Continue/Cancel dialog
        pass  # user chose Continue
    else:
        sys.exit(0)  # user chose Cancel

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值