os - win 7
python 3.7
tkinter последней версии
КОД:
def Time_by(clock=0):
by_panelvar.set(clock)
global coins
global clock_by
global clock_buust
if coins >= clock_by:
coins = coins - clock_by
clock_by*=2
root.after(1000, lambda: Time_by(clock+1), print(clock))
frame['text'] = coins
frame_1['text'] = clock
#Check Shop.
Price_sec['text'] = clock_by
else:
Price_sec['text'] = clock_by
в чём проблема?
python 3.7
tkinter последней версии
КОД:
def Time_by(clock=0):
by_panelvar.set(clock)
global coins
global clock_by
global clock_buust
if coins >= clock_by:
coins = coins - clock_by
clock_by*=2
root.after(1000, lambda: Time_by(clock+1), print(clock))
frame['text'] = coins
frame_1['text'] = clock
#Check Shop.
Price_sec['text'] = clock_by
else:
Price_sec['text'] = clock_by
Python:
from tkinter import *
root = Tk()
root.title('Clicer')
root.update()
coin = 1
coins = 0
ten = 10
XX2 = 1
clock_by = 2
clock_buust = 1
while_time = 300
root.geometry('480x340')
root.resizable(width=False, height=False)
def msg():
global coin
global coins
global text
coins += int(coin * XX2)
frame['text'] = coins
def Shop_Open():
def X2():
global coins
global ten
global XX2
if coins >= ten:
coins = coins - ten
ten += int(ten * 2)
XX2 += 1 * 2
frame['text'] = coins
Price['text'] = ten
else:
Price['text'] = ten
def Time_by(clock=0):
by_panelvar.set(clock)
global coins
global clock_by
global clock_buust
if coins >= clock_by:
coins = coins - clock_by
clock_by*=2
root.after(1000, lambda: Time_by(clock+1), print(clock))
frame['text'] = coins
frame_1['text'] = clock
#Check Shop.
Price_sec['text'] = clock_by
else:
Price_sec['text'] = clock_by
by_panelvar = StringVar()
by_panelvar.set(u'original value')
by_panel = Tk()
by_panel.title('Shop')
by_panel.geometry('280x140')
by_panel.resizable(width=False, height=False)
by_panel.update()
Shop_panel = PanedWindow(by_panel, orient=HORIZONTAL)
Shop_panel.grid()
Price = Label(by_panel, width=10, height=1)
Price.grid()
By_x2 = Button(by_panel, text='By_x3',bg='red', command=X2)
By_x2.place(x=5, y=16)
Price_sec = Label(by_panel, width=10, height=1)
Price_sec.place(x=0, y=40)
By_1sec = Button(by_panel, text='1_in_sec', bg='orange', command=Time_by )
By_1sec.place(x=5, y=56)
by_panel.mainloop()
frame = StringVar()
frame = Frame()
frame.pack()
frame.update()
frame = Label(frame, width=30, height=2, bg='black', fg='white')
frame_1 = Label(width=20, height=2, bg='green', fg='white')
frame_1.place(x=340, y=0)
# button_image = PhotoImage(file='button.png') """image=button_image,"""
top = Frame()
top.pack()
top.update()
Clisc_buttob = Button(top, text='clic', width=200, height=200,
command=msg, overrelief=SUNKEN)
Clisc_buttob.pack(side=BOTTOM)
Shop_button = Button(text='Shop', command=Shop_Open)
Shop_button.place(x=0)
frame.pack()
root.mainloop()
в чём проблема?