Python tkinter buton sinyal göndermiyor/Label kendini güncellemiyor

Eymen1001

Hectopat
Katılım
1 Mart 2021
Mesajlar
80
Daha fazla  
Cinsiyet
Erkek
Merhaba. Bir hesap makinesi yapıyordum, butonları ve Labeli doğru çalışacak şekilde yaptıktan sonra sayılarla işlemleri yapmak için bir sistem yaptım (Daha tamamlamadım eğer kodla yardım etmek için ne yaptığını veya nasıl çalışdığını sorarsanız açıklarım.). Bu sistemden sonra butonlar veya label çalışmamaya başladı. Kodu iyice inceledim ama bulamadım.Bu arada telefonda yaptım bu yüzden bilgisiyarda doğru çalışmayabilir Telefondaki her uygulamada açmıyor pydroid3 kullanabilirsiniz.
Kod:

Python:
import tkinter as tk
e, ç,x = '', '',0
def quit():
    a.quit()
def ns(fa):
    global x
    x = fa
def fn(f):
    global e, ç
    if x == 0:
        e = str(e) + str(f)
        var.set(e)
    elif x == 1:
        ç = str(ç) + str(f)
        vara.set(ç)
def qs(qs):
    qs = str(qs)
#def komutlarının arasındaki ns
#fonksiyonu ve x değişkeni işlemler
#için yaptığım sistemin bir parçası
a = tk.Tk()
a.configure(bg="black")
var = tk.StringVar()
vara = tk.StringVar()
non = tk.StringVar()
# non değişkenide sistemin bir parçası ama daha tamamlamadım ayrıca burda error vermiyor
nona = str(var) + str(non) + str(vara)
d = tk.Label(a, textvariable=nona, anchor="e", height=3, width=21)
d["bg"]=("black")
d["fg"]=("white")
d["font"]=("Arial",16)
d.place(x=0,y=140)
ns(0)
b = tk.Button(a, text="çıkış", command=quit, anchor="center", width=39, highlightthickness=3)
b["bg"]=("black")
b["fg"]=("white")
b.grid(row=0,column=0)
c = tk.Button(a, text="0", command=lambda:  fn(0), anchor="center", height=5, width=10, highlightthickness=3)
c["bg"]=("black")
c["fg"]=("white")
c.place(x=0,y=500)
g = tk.Button(a, text="1",command=lambda: fn(1), anchor="center", height=5, width=10,highlightthickness=3)
g["bg"]=("black")
g["fg"]=("white")
g.place(x=365,y=500)
ğ = tk.Button(a, text="2",command=lambda:  fn(2), anchor="center", height=5, width=9, highlightthickness=3)
ğ["bg"]=("black")
ğ["fg"]=("white")
ğ.place(x=730,y=500)
h = tk.Button(a, text="3", command=lambda: fn(3), anchor="center", height=5, width=10, highlightthickness=3)
h["bg"]=("black")
h["fg"]=("white")
h.place(x=0,y=815)
ı = tk.Button(a, text="4",command=lambda: fn(4), anchor="center", height=5, width=10,highlightthickness=3)
ı["bg"]=("black")
ı["fg"]=("white")
ı.place(x=365,y=815)
j = tk.Button(a, text="5",command=lambda: fn(5), anchor="center", height=5, width=9,highlightthickness=3)
j["bg"]=("black")
j["fg"]=("white")
j.place(x=730,y=815)
k = tk.Button(a, text="6", command=lambda: fn(6), anchor="center", height=5, width=10, highlightthickness=3)
k["bg"]=("black")
k["fg"]=("white")
k.place(x=0,y=1130)
l = tk.Button(a, text="7",command=lambda: fn(7), anchor="center", height=5, width=10,highlightthickness=3)
l["bg"]=("black")
l["fg"]=("white")
l.place(x=365,y=1130)
m = tk.Button(a, text="8",command=lambda: fn(8), anchor="center", height=5, width=9,highlightthickness=3)
m["bg"]=("black")
m["fg"]=("white")
m.place(x=730,y=1130)
n = tk.Button(a, text="9", command=lambda: fn(9), anchor="center", height=5, width=10, highlightthickness=3)
n["bg"]=("black")
n["fg"]=("white")
n.place(x=0,y=1445)
a.mainloop()
 
Son düzenleme:

Technopat Haberler

Geri
Yukarı