这个问题的出现是将desinger中的ui界面转换成代码是出现的错误,如图
这个错误有两种情况,网上博客大部分提到了第一种,有关配置的问题,PyUIC的配置出现错误,有很多很多博客细节的讲解了这个问题,我这里展示一下两种配置方法,都是可以用而且没问题的
Name: Pyuic
Group: Qt
Program: Python环境目录\python.exe所在目录
Parameters: -m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
Working directory: $FileDir$
第二种
Name: Pyuic
Group: Qt
Program: Python环境目录\Scripts\pyuic5.exe
Parameters: $FileName$ -o
$FileNameWithoutExtension$.py
$FileNameWithoutExtension$.py
Working directory: $FileDir$
这种错误很普遍,这里不再赘述。文章来源:https://www.toymoban.com/news/detail-719294.html
这里还有另一种情况,是UI界面的命名不规范导致的
这个一般不会出错,但是我的desinger当时自动生成的就有空格,而且网上介绍这方面的内容较少,所以卡了半天WWW
这里第一个Dialog - untitled.ui是会报错Error: one input ui-file must be specified但是下面的untitled.ui就不会报错,因为前者出现了空格
我后来测试了一下加下划线等链接符的命名方式,不会出错。
所以这里一定要注意不加空格。
新人初学PyUIC,如有错误的地方,还希望大佬们多多指正。
return code;文章来源地址https://www.toymoban.com/news/detail-719294.html
到了这里,关于Python PyUIC Error: one input ui-file must be specified的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!