Pyqt5纠错笔记1.1
.ui文件转为.py文件报错。
- 错误:
Error: No such file or directory: “test.py”
操作:
输入命令:pyuic5 -o test.ui test.py
原因分析:
应输入命令:pyuic5 -o test.py test.ui
- 错误:
Error in input file: not well-formed (invalid token): line 1, column 1
操作:
输入命令:pyuic5 -o test.py test.ui
原因分析:
这个错误紧跟上一个错误,因为上一个错误导致.ui文件被覆盖为:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Hellowworld.py'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
所以,即使你输入正确的命令也会报错,重新生成一个新的.ui文件即可。