NameError: name 'Window' is not defined

Почему возникает эта ошибка? помогите,пожалуйста

from PyQt5.QtWidgets import QApplication,QWidget,QMainWindow
from PyQt5 import uic, QtCore,QtTest
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import QThread
import keyboard, pyautogui, os

class App(QWidget):
    def __init__(self):
        QWidget.__init__(self)
        self.set()

    def set(self):
        self.w_goldhunter = uic.loadUiType("goldhunter.ui")
        self.w_goldhunter.btn_more.clicked.connect(self.thread)


    def thread(self):
      while keyboard.is_pressed("Esc") == False:

       for f in files:

        picture = "syndyk/" + f

        button = pyautogui.locateOnScreen(picture, confidence = 0.95)

        if button:
            pyautogui.click(button)
            pyautogui.sleep(0.1)

app = QApplication([])
window = Window()
form = Form()
form.setupUi(window)
window.show()
app.exec()

Ответы (0 шт):