Nimish Bansal
Nimish Bansal

Reputation: 1759

Not Responding when using PyQt

I just began to learn PyQt5 in python and the window which opens becomes not respondingenter image description here

import sys
import PyQt5
from PyQt5 import QtWidgets
from PyQt5 import QtCore
x=QtWidgets.QApplication(sys.argv)
y=QtWidgets.QWidget()
y.show()

Upvotes: 0

Views: 482

Answers (1)

aoh
aoh

Reputation: 1160

Try adding the following line to the end of your code:

sys.exit(x.exec_())

I would also recommend following a tutorial such as this one as PyQt does have a framework which needs to be followed closely. (http://zetcode.com/gui/pyqt5/firstprograms/)

Upvotes: 1

Related Questions