PyCharm模板

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/PZ0605/article/details/102754854
模板定义方法
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191026114600734.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1BaMDYwNQ==,size_16,color_FFFFFF,t_70)
  1. pyqt5 窗口模板

    # -*- coding: utf-8 -*-
    from PyQt5.Qt import  *
    
    class Window(QWidget):
        def __init__(self):
            super().__init__()
            self.setWindowTitle("Test")
            self.resize(500,500)
            self.setup_ui()
        def setup_ui(self):
            gl = QGridLayout()
            self.setLayout(gl)
    
    if __name__ == '__main__':
        import sys
        app = QApplication(sys.argv)
        window = Window()
        window.show()
        
        sys.exit(app.exec_())
    

猜你喜欢

转载自blog.csdn.net/PZ0605/article/details/102754854