Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\(ben varım)\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1882, in __call__
try:
KeyboardInterrupt
benim kodum tam olarak
from tkinter import *
import tkinter.font as font
# Sayaç için
# Import time
# Time.sleep(second)
# Sayaç Adı
t = 59
# Soru 1
opa = "1"
opb = "2"
opc = "3"
opd = "4"
soru1 = "abc"
# Soru 2
opa2 = "1"
opb2 = "2"
opc2 = "3"
opd2 = "4"
soru2 = "abc"
# Soru 3
opa3 = "1"
opb3 = "2"
opc3 = "3"
opd3 = "4"
soru3 = "abc"
# Soru 4
opa4 = "1"
opb4 = "2"
opc4 = "3"
opd4 = "4"
soru4 = "abc"
# Soru 5
opa5 = "1"
opb5 = "2"
opc5 = "3"
opd5 = "4"
soru5 = "abc"
# Soru 6
opa6 = "1"
opb6 = "2"
opc6 = "3"
opd6 = "4"
soru6 = "abc"
# Soru Değişkeni
qnumber = 1
# Puan Değişkeni
scoreboard = 1
# Sayaç
def countdown():
global t
if t > 0:
timelabel.config(text=t)
t = t - 1
timelabel.after(1000, countdown)
elif t == 0:
suredoldu()
# Soru 2
def page2():
global op1
global op2
global op3
global op4
global question
global score
global nextbutton
global scoreboardtext
global t
global truefalse
op1.config(text=opa2, command=yanlis)
op1.place(x=150, y=170)
op2.config(text=opb2, command=yanlis)
op2.place(x=240, y=170)
op3.config(text=opc2, command=dogru)
op3.place(x=140, y=230)
op4.config(text=opd2, command=yanlis)
op4.place(x=250, y=230)
question.config(text=soru2)
question.place(x=30, y=115)
score.config(text="2" + "/6")
nextbutton.config(command=page3)
scoreboardtext.config(text="Puan = " + str(scoreboard))
op1.config(state=NORMAL)
op2.config(state=NORMAL)
op3.config(state=NORMAL)
op4.config(state=NORMAL)
t = 59
truefalse.place(x=555, y=555)
# Soru 3
def page3():
global op1
global op2
global op3
global op4
global question
global score
global nextbutton
global scoreboardtext
global t
global truefalse
op1.config(text=opa3, command=yanlis)
op1.place(x=130, y=170)
op2.config(text=opb3, command=dogru)
op2.place(x=260, y=170)
op3.config(text=opc3, command=yanlis)
op3.place(x=130, y=230)
op4.config(text=opd3, command=yanlis)
op4.place(x=230, y=230)
question.config(text=soru3)
question.place(x=80, y=115)
score.config(text="3" + "/6")
nextbutton.config(command=page4)
scoreboardtext.config(text="Puan = " + str(scoreboard))
op1.config(state=NORMAL)
op2.config(state=NORMAL)
op3.config(state=NORMAL)
op4.config(state=NORMAL)
t = 59
truefalse.place(x=555, y=555)
# Soru 4
def page4():
global op1
global op2
global op3
global op4
global question
global score
global nextbutton
global scoreboardtext
global t
global truefalse
op1.config(text=opa4, command=yanlis)
op1.place(x=140, y=170)
op2.config(text=opb4, command=yanlis)
op2.place(x=250, y=170)
op3.config(text=opc4, command=dogru)
op3.place(x=140, y=230)
op4.config(text=opd4, command=yanlis)
op4.place(x=250, y=230)
question.config(text=soru4)
question.place(x=50, y=115)
score.config(text="4" + "/6")
nextbutton.config(command=page5)
scoreboardtext.config(text="Puan = " + str(scoreboard))
op1.config(state=NORMAL)
op2.config(state=NORMAL)
op3.config(state=NORMAL)
op4.config(state=NORMAL)
t = 59
truefalse.place(x=555, y=555)
# Soru 5
def page5():
global op1
global op2
global op3
global op4
global question
global score
global nextbutton
global scoreboardtext
global t
global truefalse
op1.config(text=opa5, command=dogru)
op1.place(x=100, y=170)
op2.config(text=opb5, command=yanlis)
op2.place(x=200, y=170)
op3.config(text=opc5, command=yanlis)
op3.place(x=100, y=230)
op4.config(text=opd5, command=yanlis)
op4.place(x=200, y=230)
question.config(text=soru5)
question.place(x=25, y=115)
score.config(text="5" + "/6")
nextbutton.config(command=page6)
scoreboardtext.config(text="Puan = " + str(scoreboard))
op1.config(state=NORMAL)
op2.config(state=NORMAL)
op3.config(state=NORMAL)
op4.config(state=NORMAL)
t = 59
truefalse.place(x=555, y=555)
# Soru 6
def page6():
global op1
global op2
global op3
global op4
global question
global score
global nextbutton
global scoreboardtext
global t
global truefalse
op1.config(text=opa6, command=yanlis)
op1.place(x=125, y=170)
op2.config(text=opb6, command=yanlis)
op2.place(x=250, y=170)
op3.config(text=opc6, command=yanlis)
op3.place(x=125, y=230)
op4.config(text=opd6, command=dogru)
op4.place(x=265, y=230)
question.config(text=soru6)
question.place(x=4, y=115)
score.config(text="6" + "/6")
scoreboardtext.config(text="Puan = " + str(scoreboard))
op1.config(state=NORMAL)
op2.config(state=NORMAL)
op3.config(state=NORMAL)
op4.config(state=NORMAL)
nextbutton.config(command=pagefinish)
t = 59
truefalse.place(x=555, y=555)
# Bitiş Ekranı
def pagefinish():
global nextbutton
global question
global buttonquit
global timelabel
global op1
global op2
global op3
global op4
global score
global scoreboardtext
global t
question.config(text="Tebrikler Bitirdin")
question.place(x=130, y=115)
scoreboardtext.place(x=160, y=155)
score.place(x=555, y=555)
timelabel.place(x=555, y=555)
op1.place(x=555, y=555)
op2.place(x=555, y=555)
op3.place(x=555, y=555)
op4.place(x=555, y=555)
nextbutton.place(x=555, y=555)
buttonquit.place(x=205, y=300)
t = 9999999
question['font'] = finishfont
scoreboardtext['font'] = finishfont
# Doğru Ekranı
def dogru():
global truefalse
global opd
global scoreboard
global op1
global op2
global op3
global op4
global truefalse
op1.config(state=DISABLED)
op2.config(state=DISABLED)
op3.config(state=DISABLED)
op4.config(state=DISABLED)
scoreboard = scoreboard + 1
truefalse.config(text="Doğru")
truefalse.place(x=330, y=50)
# Yanlış Ekranı
def yanlis():
global scoreboard
global truefalse
global op1
global op2
global op3
global op4
op1.config(state=DISABLED)
op2.config(state=DISABLED)
op3.config(state=DISABLED)
op4.config(state=DISABLED)
scoreboard = scoreboard - 1
truefalse.config(text="Yanlış")
truefalse.place(x=330, y=50)
# Süre Doldu Ekranı
def suredoldu():
global truefalse
global scoreboard
global op1
global op2
global op3
global op4
scoreboard = scoreboard - 1
op1.config(state=DISABLED)
op2.config(state=DISABLED)
op3.config(state=DISABLED)
op4.config(state=DISABLED)
truefalse.config(text="Süre Doldu")
truefalse.place(x=310, y=50)
# The Screen
window = Tk()
window.title("The Quiz")
window.geometry("450x350")
window['background'] = '#e9e9e9'
# The Image
image = PhotoImage(file="11.png")
imagelogo = Label(image=image)
imagelogo.place(x=1, y=1)
# Fonts
finishfont = font.Font(size=20)
questionfont = font.Font(size=18)
optionfont = font.Font(size=14)
scorefont = font.Font(size=18)
exitfont = font.Font(size=13)
# Question
question = Label(text=soru1, fg="black")
question.place(x=15, y=115)
question['font'] = questionfont
# Score
scoreboardtext = Label(text="Puan = " + str(scoreboard), fg="black")
scoreboardtext['font'] = scorefont
scoreboardtext.place(x=320, y=10)
# Question Number
score = Label(text=str(qnumber) + "/6", fg="black")
score['font'] = scorefont
score.place(x=5, y=10)
# True/False Screen
truefalse = Label(text="Süre Doldu", fg="black", bg="#e9e9e9")
truefalse['font'] = scorefont
truefalse.place(x=555, y=50)
# Option 1
op1 = Button(text="A)" + " " + opa, fg="grey", bg="#e9e9e9", command=yanlis)
op1.place(x=150, y=170)
op1['font'] = optionfont
# Option 2
op2 = Button(text="B)" + " " + opb, fg="grey", bg="#e9e9e9", command=dogru)
op2.place(x=240, y=170)
op2['font'] = optionfont
# Option 3
op3 = Button(text="C)" + " " + opc, fg="grey", bg="#e9e9e9", command=yanlis)
op3.place(x=150, y=230)
op3['font'] = optionfont
# Option 4
op4 = Button(text="D)" + " " + opd, fg="grey", bg="#e9e9e9", command=yanlis)
op4.place(x=240, y=230)
op4['font'] = optionfont
# Quit Button
buttonquit = Button(text="Quit", fg="grey", bg="#e9e9e9", command=quit)
buttonquit.place(x=380, y=300)
buttonquit['font'] = exitfont
# Next Button
nextbutton = Button(window, text="Next", fg="grey", bg="#e9e9e9", command=page2)
nextbutton['font'] = exitfont
nextbutton.place(x=205, y=300)
# Time
timelabel = Label(window, fg="black")
timelabel['font'] = scorefont
timelabel.place(x=225, y=0.25)
# Countdown
countdown()
# Making Everything
window.mainloop()
Nasıl bu ne yapmam lazım bilen var mı bu konuda
Ayrıca bu sitede yeniyim bu ilk konum o yüzden bazı şeyleri yanlış yapmış olabilirim