当前位置:网站首页>Pyqt5 learning resource preparation and environment configuration
Pyqt5 learning resource preparation and environment configuration
2022-07-20 12:08:00 【A misty rain and fine rain】
choose 《Python Qt GUI And data visualization programming 》 To study , This book Source code and color map
Let's sort it out first B Stop video tutorial ——PyQt5 course Resources in the comment area :
This tutorial is mainly PyQt5 Rapid development and actual combat
pyuic To configure :
program: python Interpreter
arguments: -m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
working directory: $ProjectFileDir$about anaconda My classmate said there was a pit : If using anaconda Classmate , If you use pycharm .UI turn .py There is no prompt when file module, You can try pip stay base Environmental installation PyQt package ( Do not use conda command , use pip) Then try again ;
I find Actually anaconda There is pyqt Of , But because the environment variable is not added there, it cannot , Need to put anaconda Of anaconda3,anaconda3\Scripts,anaconda3\Library\bin Add it to the system environment variable ok 了Please set the environment variable pyuic5 It will still be prompted that it is not an internal or external command … How to solve it
Qt designer Drag and drop control implementation UI Interface tools , After the design is completed and saved, it is . ui file ,pyuic5 Can be . ui File conversion to . py file , and uic Can be . ui File conversion to . h The header file
So is mine , Later Baidu said it was anaconda in script Inside pyuic5, I tried it. It can . I don't know what it is .stay conda base I use pyuic Report errors The lack of python3.dll, Try the method on the Internet without result , Then reinstall in the virtual environment pyqt5 and tools
If it is configured in a virtual environment pyqt You can refer to the following links :
1、 Tsinghua image download and installation :https://www.cnblogs.com/shelly-blog/p/13615580.html
2、 To configure external tools:https://blog.csdn.net/ChaoFeiLi/article/details/88418248
3、 Some questions :
3.1 pyqt5_tools I can't find designer.exe The problem of
3.1 solve :https://blog.csdn.net/rong81590509/article/details/101012280 Or search in the folder by yourself designer.exe Find the path
3.2 To configure pyuic encounter error: no such option: -m The problem of
solve : The argument Parameters https://blog.csdn.net/weixin_41529093/article/details/108904183Set up “PyUIC”:
Program:python Under the installation directory of python.exe file . Or your Anconda Of env In the environment of
Arguments:-m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
working directory: Yours ui The path of the file . Such as your ui The file path is :F:\tensorflow_exercise\AQM_GUI\test.ui , Then... Should be written here F:\tensorflow_exercise\AQM_GUI. Here $FileDir$ Is the path of the current folder . In case of a one thousand , You open the one on the right insert Macros, Click on the options inside , The preview path appears below , Choose the command you need .
Reference resources :https://blog.csdn.net/f156207495/article/details/77505964
Be careful : First, my working directory Is written $ProjectFileDir$( Project path ) But always report mistakes , Then I refer to the blog in the above link , I found that it should be filled here $FileDir$( The path to the current folder )This script will ui Get all ui Document conversion py file Share one I wrote ui-py Script
Create a new one ui Directory to store ui file , Then execute the following script to directly transfer
import os
ui_path = ../ui
a = {
}
for file in os.listdir(ui_path):
if file.find(.ui) == len(file)-len(.ui):
# list_ui.append(file)
a【file】 = file.split(.)【0】+.py
print(a)
# Switch to ui Catalog speed of progress cmd perform ui-py command
os.chdir(ui_path)
CMD_LINE = python -m PyQt5.uic.pyuic {
} -o {
}
for api in a.items():
print(api【0】)
ret = os.system(CMD_LINE.format(api【0】,api【1】))
if ret == 0:
print(----------\n{
} change to {
} success\n----------------.format(api【0】,api【1】))
else:
print(----------\n{
} change to {
} 【ERROR】\n----------------.format(api【0】,api【1】))
print(done)
- PyQt5 in Qt Designer and PyUIC Settings of extension tools
- object-oriented programming 1 object-oriented programming 2
- testing anaconda Whether the environment variable of is successfully added ,win+r Key on run , Input cmd, Input conda, If anaconda Add success , It will show a lot of things , Or open anaconda prompt, Input pip list, The current anaconda All packages in the environment
边栏推荐
- Optimization case 2: select scalar subquery and sort main query
- Cloud foundry developer course (lfd232) 3 core concepts
- 三层交换技术
- 基于MATLAB的无限脉冲响应数字滤波器的设计与仿真
- Exclusive thought of DOM series
- 云呐-fsu动环监控单元,fsu动环监控单元是什么
- 每周推荐短视频:对云计算的弹性算力提出了更高要求
- Relationship extraction onerel
- 读论文:(YOLOv1)You Only Look Once:Unified, Real-Time Object Detection
- 【微信小程序】input输入框(87/100)
猜你喜欢
Resolved (selenium reports an error) attributeerror: 'webdriver' object has no attribute 'execute_ cdp_ cmd‘
MySQL learning notes - stored procedures and functions
Modeling and Simulation of DC speed regulation system based on Fuzzy PID control
Fractional PID control and vector control permanent magnet motor
GameFi 行业下滑但未出局| June Report
What is reverse proxy?
分数阶pid控制和矢量控制永磁电机
Vs2017 opencv3.4.2 is compiled into x86 through the release version source code
【微信小程序】断点调试一
每周推荐短视频:对云计算的弹性算力提出了更高要求
随机推荐
Game 302 of leetcode
三层交换技术
DOM introduction and acquisition of DOM series
The Permutation Results by backtracking method (dfs)
Resolved (selenium reports an error) attributeerror: 'webdriver' object has no attribute 'execute_ cdp_ cmd‘
源码编译安装LAMP
DOM系列之样式属性操作
IPv6-基础
恢复360收藏夹方法 电脑损坏、重装系统后,把360sefav_new_2021_07_16.favdb这种文件,复制到别的电脑上,含有字符new的文件是加密的无法恢复
Simulation of PID tuning method in flow control system
Relationship extraction onerel
GameFi 行业下滑但未出局| June Report
Big programmers' daily work | daily anecdotes
【TA-霜狼_may-《百人计划》】图形2.8 Flowmap的实现
LabVIEW depicts analog waveform and digital waveform under the same panel
shell函数数组作业
【golang学习笔记1.7】 golang中的函数得使用
【微信小程序】checkbox复选框(89/100)
win7进程命令
How much is the price of the moving ring monitoring system