S
S
sswwssww2019-10-25 10:54:37
Python
sswwssww, 2019-10-25 10:54:37

There is a PyQt5 template, how to run it?

There is a PyQt5 template:

from PyQt5 import QtCore
from PyQt5 import QtWidgets


class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(425, 276)
        self.ssz = QtWidgets.QLabel(Dialog)
        self.ssz.setGeometry(QtCore.QRect(150, 70, 191, 16))
        self.ssz.setObjectName("ssz")
        self.psk = QtWidgets.QLabel(Dialog)
        self.psk.setGeometry(QtCore.QRect(150, 30, 141, 16))
        self.psk.setObjectName("psk")
        self.psk_ed = QtWidgets.QLineEdit(Dialog)
        self.psk_ed.setGeometry(QtCore.QRect(20, 30, 113, 20))
        self.psk_ed.setObjectName("psk_ed")
        self.ssz_ed = QtWidgets.QLineEdit(Dialog)
        self.ssz_ed.setGeometry(QtCore.QRect(20, 70, 113, 20))
        self.ssz_ed.setObjectName("ssz_ed")
        self.kilmes_ed = QtWidgets.QLineEdit(Dialog)
        self.kilmes_ed.setGeometry(QtCore.QRect(20, 110, 113, 20))
        self.kilmes_ed.setObjectName("kilmes_ed")
        self.mes = QtWidgets.QLabel(Dialog)
        self.mes.setGeometry(QtCore.QRect(150, 110, 251, 16))
        self.mes.setObjectName("mes")
        self.spz_ed = QtWidgets.QLineEdit(Dialog)
        self.spz_ed.setGeometry(QtCore.QRect(20, 150, 113, 20))
        self.spz_ed.setObjectName("spz_ed")
        self.spz = QtWidgets.QLabel(Dialog)
        self.spz.setGeometry(QtCore.QRect(150, 150, 191, 16))
        self.spz.setObjectName("spz")
        self.pushButton = QtWidgets.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(330, 220, 71, 21))
        self.pushButton.setObjectName("pushButton")
        self.sred_mplat_label = QtWidgets.QLabel(Dialog)
        self.sred_mplat_label.setGeometry(QtCore.QRect(20, 220, 141, 16))
        self.sred_mplat_label.setObjectName("sred_mplat_label")
        self.line = QtWidgets.QFrame(Dialog)
        self.line.setGeometry(QtCore.QRect(10, 200, 401, 16))
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.line_3 = QtWidgets.QFrame(Dialog)
        self.line_3.setGeometry(QtCore.QRect(-7, 20, 31, 231))
        self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_3.setObjectName("line_3")
        self.line_4 = QtWidgets.QFrame(Dialog)
        self.line_4.setGeometry(QtCore.QRect(400, 20, 31, 231))
        self.line_4.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_4.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_4.setObjectName("line_4")
        self.line_8 = QtWidgets.QFrame(Dialog)
        self.line_8.setGeometry(QtCore.QRect(10, 241, 401, 20))
        self.line_8.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_8.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_8.setObjectName("line_8")
        self.groupBox_2 = QtWidgets.QGroupBox(Dialog)
        self.groupBox_2.setGeometry(QtCore.QRect(10, 20, 401, 171))
        self.groupBox_2.setTitle("")
        self.groupBox_2.setObjectName("groupBox_2")
        self.final_summ = QtWidgets.QLabel(Dialog)
        self.final_summ.setGeometry(QtCore.QRect(170, 180, 61, 16))
        self.final_summ.setText("")
        self.final_summ.setObjectName("final_summ")
        self.line_2 = QtWidgets.QFrame(Dialog)
        self.line_2.setGeometry(QtCore.QRect(10, 10, 401, 16))
        self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_2.setObjectName("line_2")
        self.groupBox_3 = QtWidgets.QGroupBox(Dialog)
        self.groupBox_3.setGeometry(QtCore.QRect(10, 220, 401, 21))
        self.groupBox_3.setTitle("")
        self.groupBox_3.setObjectName("groupBox_3")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
        self.ssz.setText(_translate("Dialog", "Сумма срочной задолженности"))
        self.psk.setText(_translate("Dialog", "Полная стоимость кредита"))
        self.mes.setText(_translate("Dialog", "Количество месяцев, оставшихся до погашения"))
        self.spz.setText(_translate("Dialog", "Сумма просроченной задолженности"))
        self.pushButton.setText(_translate("Dialog", "Расчет"))
        self.sred_mplat_label.setText(_translate("Dialog", "Среднемесячный платеж: "))

. How to make it work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Temnikov, 2019-10-25
@sswwssww

https://tproger.ru/translations/python-gui-pyqt read from the section "Turning design into code", but it's better to read the whole article, it's not big, useful for development

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question