-2

I'm doing a little program in tkinter, but it doesn't works, cause when I press F5 to execute the code, A pop-up appears saying: Tab/space error .Here is my code:

def codigo():
global text2
f2=Frame(f, width=300, height=500)
f2.pack()
f2.config(bg='dark grey')
text2=Label(f, text=spin.get(), font=('Arial Bold', 90), bg=('dark grey'))
text2.place(x=80, y=200)
timer.current = int(spin.get())
timer()
if text2 == 0:
    timerc = int(spin3.get())
    timer2()
text3=Label(f, text=int(spin3.get()), font=('Arial Bold', 30), bg=('dark grey'))
text3.place(x=200, y=350)
text4=Label(f, text=spin4.get(), font=('Arial Bold', 30), bg=('dark grey'))
text4.place(x=170, y=400)
text5=Label(f, text='Ejercicios:', font=('Arial Bold', 30), bg=('dark grey'))
text5.place(x=5, y=350)
text6=Label(f, text='Rondas:', font=('Arial Bold', 30), bg=('dark grey'))
text6.place(x=5, y=400)
if text2==0:
    text3(text=(int(spin3.get())-1))        

The problem, is in text3(text=(int(spin3.get())-1)) but i don't know why.

Thanks.

1 Answers1

1

There is corrected code:

def codigo():
    global text2
    f2=Frame(f, width=300, height=500)
    f2.pack()
    f2.config(bg='dark grey')
    text2=Label(f, text=spin.get(), font=('Arial Bold', 90), bg=('dark grey'))
    text2.place(x=80, y=200)
    timer.current = int(spin.get())
    timer()
    if text2 == 0:
        timerc = int(spin3.get())
        timer2()
    text3=Label(f, text=int(spin3.get()), font=('Arial Bold', 30), bg=('dark grey'))
    text3.place(x=200, y=350)
    text4=Label(f, text=spin4.get(), font=('Arial Bold', 30), bg=('dark grey'))
    text4.place(x=170, y=400)
    text5=Label(f, text='Ejercicios:', font=('Arial Bold', 30), bg=('dark grey'))
    text5.place(x=5, y=350)
    text6=Label(f, text='Rondas:', font=('Arial Bold', 30), bg=('dark grey'))
    text6.place(x=5, y=400)
    if text2==0:
        text3(text=(int(spin3.get())-1))
n1tr0xs
  • 408
  • 2
  • 9
  • I copyed it bad, sorr. I edited it. In the code, the tabs are only I need –  Jan 30 '20 at 10:12