Sil butonu çalışmıyor

def click(value):
if value == “Sil”:
entry2 = entry.get()
pos = entry2.find("")
pos2 = entry2[pos:]
entry.delete(pos2, tk.END)
elif value == " Space ":
entry.insert(tk.END, “”)
else:
entry.insert(tk.END, value)

button_list = [“q”, “w”, “e”, “r”, “t”, “y”, “u”, “i”, “o”, “p”, “Sil”, “a”, “s”, “d”, “f”, “g”, “h”, “j”, “k”, “l”, “z”,
“x”, “c”, “v”, “b”, “n”, “m”, " Space "]

x = 325
y = 600
count = 0

for b in button_list:
rel = “groove”
command = lambda x=b: click(x)
if b != " Space ":
tk.Button(pencere, text=b, width=5, relief=rel, command=command).place(x=x, y=y)
elif b == " Space ":
tk.Button(pencere, text=b, width=30, relief=rel, command=command).place(x=x, y=y)

x += 40
count += 1
if count == 11:
    x = 360
    y += 25
elif count == 20:
    x = 400
    y += 24
elif count == 27:
    x = 430
    y += 25

Sil butonu var fakat çalışmıyor bu bi ekran klavyesi düzgün bir silme kodu var mı?

bkz: Soru Sorarken Sıkça Düşülen Hatalar #1

1 Beğeni

Burayı

if value == "Sil":
    entry.delete(0, 'end')

Bununla değiştirirseniz çalışacaktır.

2 Beğeni