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
easygui的使用
最新推荐文章于 2024-07-26 00:00:00 发布