我是python的新手,当我碰到一堵墙的时候,我正在用easygui做一个小程序。我想按一下“后退”按钮,让我回到上一行,但我不知道该怎么做。我在网上搜索了一下,找到了while循环,但我不知道怎么把它放进去。谢谢你的评论。你知道吗
from easygui import *
msg = "Enter Login Information";
title = "";
fieldNames = ["Username", "Password"];
fieldValues = [];
fieldValues = multpasswordbox(msg,title,fieldNames);
USERNAME, PASSWORD = fieldValues[0], fieldValues[1];
if USERNAME == "username" and PASSWORD == "password":
#This is where i would like the button to take me
msg = "What would you like to do?"
title = "Options"
choices=['passwords','usernames','other','close']
choice=buttonbox(msg, title,choices)
if choice=='passwords':
msg = "Here is the info you requested"
title = "Passwords"
choices=['Back']
choice=buttonbox(msg, title,choices)
if choice=='Back': #this is the button
elif choice=='usernames':
msgbox("Here is the info you requested")
elif choice=='other':
msgbox("Here is the info you requested")
else:
msgbox("Access Denied");
目前没有回答
相关问题 更多 >
编程相关推荐