I am trying to run this code below and getting an issue of wrong syntax, an illegal target for annotation python(parser-16) 3.7:
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QPushButton
import sys
class MyWindow(QMainWindow):
def__init__(self):
super(MyWindow, self).def__init__()
self.setGeometry(100, 100, 300, 300)
self.setWindowTitle(“Roy’s Test”)
self.initUI()
def initUI(self):
self.label = QLabel(self)
self.label.setText(“My first Label”)
self.label.move(50, 50)
self.b1 = QPushButton(self)
self.b1.setText(‘click me’)
self.b1.clicked.connect(self.clicked)
def clicked(self):
self.label.setText(“yo pressed the QPushButton”)
self.update()
def update(self):
self.label.adjustSize()
def window():
app = QApplication(sys.argv)
win = MyWindow()
win.show()
sys.exit(app.exec_())
window()