只是放代码,别在意,不要点进来
  • 板块灌水区
  • 楼主laoqiu_tyxx
  • 当前回复3
  • 已保存回复3
  • 发布时间2024/9/16 16:00
  • 上次更新2024/9/16 16:02:06
查看原帖
只是放代码,别在意,不要点进来
1301485
laoqiu_tyxx楼主2024/9/16 16:00
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()

2024/9/16 16:00
加载中...