Python_ Design and business separation

Source: Internet
Author: User

Success Stories:

Design window

#-*-coding:utf-8-*-#Form Implementation generated from reading UI file ' Day2.ui '##Created by:pyqt5 UI code generator 5.4.1##warning! All changes made in this file would be lost! fromPyQt5ImportQtcore, Qtgui, QtwidgetsclassUi_form (object):defsetupui (Self, Form): Form.setobjectname ("Form") Form.resize (400, 300) Self.lineedit=Qtwidgets.qlineedit (Form) self.lineEdit.setGeometry (Qtcore.qrect (140, 100, 113, 20)) Self.lineEdit.setObjectName ("LineEdit") Self.retranslateui (form) QtCore.QMetaObject.connectSlotsByName (form)defRetranslateui (Self, Form): _translate=QtCore.QCoreApplication.translate Form.setwindowtitle (_translate ("Form","Form"))if __name__=="__main__":    Importsys app=qtwidgets.qapplication (sys.argv) widget=qtwidgets.qwidget () UI=ui_form () ui.setupui ((widget)) widget.show () Sys.exit (App.exec_ ())

Business code:

ImportSYS fromPyqt5.qtwidgetsImportQapplication,qwidget fromDay2ImportUi_formclassMyForm (qwidget,ui_form):def __init__(self): Super ().__init__() self.setupui (self)#Self.lineEdit.textChanged.connect (Self.label.setText)                        if __name__=='__main__': App=qapplication (SYS.ARGV) W=MyForm () w.show () app.exec_ ( )

Python_ Design and business separation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.