当前位置:网站首页>Method of converting UI file to py file
Method of converting UI file to py file
2022-07-28 04:47:00 【Worthless life】
ui The file is converted to py Document method
Method 1:
Reference link :https://blog.csdn.net/weixin_44103969/article/details/123698293
(1) install PYQT Integration plug-in unit 
(2) Select the .ui file , choice PyQT:Complite Form Options

Method 2:
Reference link :https://blog.csdn.net/qq_42589613/article/details/124285967
pyuic5 -o firstMainWin.py firstMainwin. ui
Method 3:
# -*- coding: utf-8 -*-
''' ui convert to py The conversion tool for '''
import os
import os.path
# modify UI The path of the file
dir = './'
# List all... In the directory ui file
def listUiFile():
list = []
files = os.listdir(dir)
for filename in files:
#print( dir + os.sep + f )
#print(filename)
if os.path.splitext(filename)[1] == '.ui':
list.append(filename)
return list
# Put the suffix ui Change the suffix of the file to py The name of the file
def transPyFile(filename):
return os.path.splitext(filename)[0] + '.py'
# Call the system command to ui convert to py
def runMain():
list = listUiFile()
for uifile in list :
pyfile = transPyFile(uifile)
cmd = 'pyuic5 -o {pyfile} {uifile}'.format(pyfile=pyfile,uifile=uifile)
#print(cmd)
os.system(cmd)
###### The main entry of the program
if __name__ == "__main__":
runMain()
边栏推荐
- 【sylar】框架篇-Chapter24-支持业务模块化
- 数据库故障容错之系统时钟故障
- 解析智能扫地机器人中蕴含的情感元素
- [Sylar] framework -chapter7-io coordination scheduling module
- Ma Yi, Shen Xiangyang, Cao Ying's latest AI overview is hot! It took 3 months to build, netizens: required papers
- Space complexity calculation super full sorting!! (calculation of hand tearing complexity
- Strlen introduction, and the difference between sizeof
- Redis类型
- After login, the upper right corner changes to enter the login status
- pytorch_ Lightning in lightning_ The output of hparams.yaml in logs is null
猜你喜欢

Cloud native Devops status survey questionnaire solicitation: kodelurover launched jointly with oschina

Web渗透之域名(子域名)收集方法

Leetcode 18. sum of four numbers

Full resolution of the use of go native plug-ins

How to upgrade a pair of 12.2 RAC(primary) and a pair of 12.2 RAC(dataguard) to 19c

Elementary level of C language -- while, for, do while

Leetcode 454. Adding four numbers II

Important SQL server functions - string utilities

Jupyter Notebook安装代码提示功能

Space complexity calculation super full sorting!! (calculation of hand tearing complexity
随机推荐
Internet of things industrial serial port to WiFi module wireless routing WiFi module selection
[Sylar] framework Chapter 23 summary of module chapter
(clone virtual machine steps)
gerrit操作-回退掉某个patch_set
[daily question 1] 735. Planetary collision
动态sql和分页
Explain initialization list
Installing MySQL under Linux
Use and expansion of fault tolerance and fusing
[Sylar] framework Chapter 8 timer module
Tiantian AMADA CNC bending machine touch screen maintenance rgm21003 host circuit board maintenance
Machine learning and deep learning -- normalization processing
MySQL partition table transformation
(2.4) [service Trojan -slimftp] introduction and use
Cmake usage base summary
Simple summary of Modbus Protocol
Important SQL server functions - other functions
网络安全基本知识——密码(一)
【sylar】框架篇-Chapter7-IO 协程调度模块
pytorch_ Lightning in lightning_ The output of hparams.yaml in logs is null