Commit c74a2402 by BellCodeEditor

auto save

parent eb31caca
Showing with 48 additions and 18 deletions
# 报菜名 users = {"python":"123456","bellcode":"66666"}
# 悟空和诺依到了一家特色餐馆,这家餐馆最大的特色就是有个自动报菜名机器人 while True:
# 通常它会自动说出今天的前菜有哪些汤有哪些主菜有哪些等等~ name = input("请输入用户名:")
# 可是今儿它有些bug产生的结果很奇怪,你可以检查出来么? pwd = input("请输入用户密码:")
today_menu={'前菜':{'熏鲢鱼':20,'生蚝':20,'面包':10}, if users.get(name) != pwd:
'汤':{'玉米浓汤':15,'蔬菜汤':15,'海鲜汤':15}, print("请输入正确的账号和密码")
'主菜':{'鱼':40,'虾':30,'蟹':20,'贝壳类':20}, else:
'间菜':{'牛扒':25,'煨菜':25,'肉排':30}, print("登陆成功")
"烧烤沙拉":{'需要':15,'不需要':0}, break
'甜品':{'可丽露':20,'优格吐司':15,'蓝莓松饼':20} \ No newline at end of file
}
for k,v in today_menu.items():
print('今日' + k + '有:')
for i in v.values():
print(i,end=' ') #依次告诉客人今天的各类菜有哪些选择
print()
\ No newline at end of file
import tkinter
def func1():
app1.root.destroy()
global app2
app2 = Guest()
app2.show()
def func2():
app2.root.destroy()
global app1
app1 = Admin()
app1.show()
class Admin():
def __init__(self):
self.root = tkinter.Tk()
self.root.title("主界面")
self.root.geometry('300*200+500+300')
def show(self):
button1 = thinker.Button(self.root,text='跳转',width = 15,command = func1)
button1.place(x=100, y=60)
self.root.mainloop()
class Guest():
def __init__(self):
self.root = thinter.TK()
self.root.title("副界面")
self.root.geometry('250*150+500+300')
def show(self):
button2 = thinker.Button(self.root,text='跳转',width = 15,command = func2)
button2.place(x=100, y=60)
self.root.mainloop()
app1 = Admin()
app1.show()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment