Python pyqt5 problem

Hello i am trying to create a small app with Pyqt5 on sublime text but whenever i go on gitbash and type python appname.py it always says
$ python crisp.py
File “C:\pyqt5\crisp.py”, line 4
def__init__(self):
^
SyntaxError: invalid syntax

my full code is

import PyQt5.QtWidgets as qtw

class MainWindow(qtw.QWidget):
def__init__(self):
super()init()

	# Add a title
	self.setWindowTitle("Helllo world!!!!!!")

	# Set vertical layout
	self.setLayout(qtw.QVBoxLayout())

	# Create a label
	my_label = qtw.QLabel("Hello World")
	self.layout(.addWidget(my_label))

	self.show

app = qtw.QApplication()
mw = MainWindow()

#run the app
app.exec_()

and the line with the problem is in bold

if you have any solutions please reply back to me.

Have a good day goodbye

Looks like you’re missing a space between def (a keyword) and __init__ (a method name).

2 Likes

thankyou this helped