import turtle as t
import tkinter as tk
window=tk.Tk()
window.title('神金币银行python版')
window.geometry('1200x650')
window.config(bg="white")
sjb=200
l = tk.Label(window, text='欢迎来到神金币银行python版', bg='white', font=('Arial', 30), width=60, height=4)
l.pack()
def shop():
shopw=tk.Tk()
shopw.title('商店')
shopw.geometry('900x500')
shopw.config(bg="white")
l=tk.Label(shopw, text='商店', bg='white', font=('Arial', 30), width=60, height=2)
l.pack()
d=tk.Label(shopw,text='神金币:'+str(sjb),bg='white',font=('Arial',10),width=10,height=1)
d.pack()
var=1
def buy():
dsafh=t.TK.messagebox.askquestion('神金币银行','确认购买?')
if dsafh=='yes':
if var>sjb:
t.TK.messagebox.showinfo('神金币银行','神金币不足,先去打工吧')
else:
sjb-=var
t.TK.messagebox.showinfo('神金币银行','购买成功!还剩'+str(sjb)+'个神金币')
a1=tk.Radiobutton(shopw,bg='white',text='神奇宝贝:30神金币',variable=var,value=30,command=buy)
a1.pack()
a2=tk.Radiobutton(shopw,bg='white',text='星之卡比:40神金币',variable=var,value=40,command=buy)
a2.pack()
a3=tk.Radiobutton(shopw,bg='white',text='一只球星人:250神金币',variable=var,value=250,command=buy)
a3.pack()
b=tk.Button(shopw,text='退出',font=('Arial',10),width=5,heigh=1,command=shopw.destroy)
b.pack()
b=tk.Button(window, text='商店', font=('Arial', 20), width=10, height=1, command=shop)
b.pack()