import login
dialog = login.login_dialog()
dialog.exec()
from PyQt5 import QtCore, QtGui, QtWidgets
class login_dialog(QtWidgets.QDialog):
def __init__(self,parent=None):
super(login_dialog, self).__init__(parent)
self.setObjectName("Dialog")
self.resize(400, 300)
#и так далее
QWidget: Must construct a QApplication before a QWidget
from PyQt5.QtWidgets import QApplication, QLabel
app = QApplication([])
# This is a requirement of Qt: Every GUI app must have exactly one instance of QApplication.
# Many parts of Qt don't work until you have executed the above line.
# You will therefore need it in virtually every (Py)Qt app you write.
# The brackets [] in the above line represent the command line arguments passed to the application.
# Because our app doesn't use any parameters, we leave the brackets empty.
label = QLabel('Hello World!')
label.show()
app.exec()