当前位置: 首页 > news >正文

网站开发培训深圳南京哪家做电商网站

网站开发培训深圳,南京哪家做电商网站,北京培训机构,云南建设投资集团网站前言 由于需要使用不同的qt环境#xff08;PySide#xff0c;PyQt#xff09;所以写了这个脚本#xff0c;使用找到的随便一个uic命令去转换ui文件#xff0c;然后将导入模块换成qtpy这个通用库(支持pyside2-6#xff0c;pyqt5-6)#xff0c;老版本的是Qt.py(支持pysid…前言 由于需要使用不同的qt环境PySidePyQt所以写了这个脚本使用找到的随便一个uic命令去转换ui文件然后将导入模块换成qtpy这个通用库(支持pyside2-6pyqt5-6)老版本的是Qt.py(支持pyside0-2~pyqt4-5)你可以自己改 使用 将内容保存为 ui2py.ps1 放置到后缀 ui 文件的同目录下 在拥有环境的powershell中运行 .\ui2py # .SYNOPSIS Convert all ui files in the same directory to py files for Python to use.DESCRIPTION It needs to be used on terminals that have a Python environment, making sure that pyuic* or pyside*-uic is present This script replaces the import from PyQt* or from PySide* in the py file with the from qtpy module after compilation.EXAMPLE PS .\MyScript.ps1 Run directly, no parameters required.LINK https://blog.csdn.net/weixin_42579717/article/details/137279306# # Check whether the uic command exists $_commands (pyuic5, pyside2-uic, pyuic6, pyside6-uic, pyside-uic, pyuic) $command $null foreach ($cmd in $_commands) {$command Get-Command $cmd -ErrorAction SilentlyContinueif ($command){break} } if (-not$command) {Write-Host Command not found.exit 1 } $command $command.Name Write-Output Use command: $command# Gets the folder where the current script is located $scriptDirectory Split-Path -Parent $MyInvocation.MyCommand.Definition# Perform conversion operations for all *.ui files in the folder Get-ChildItem -Path $scriptDirectory -Filter *.ui | ForEach-Object {$uiFile $_.FullName$pyFile $_.BaseName .py$pyFilePath Join-Path $scriptDirectory $pyFileWrite-Host $uiFileWrite-Host $pyFilePath# Convert .ui to .py $command -o $pyFilePath $uiFile# Check whether the file is successfully convertedif (Test-Path $pyFilePath){# Replace import module(Get-Content $pyFilePath -Encoding UTF8) -replace from (PyQt[456]?|PySide[26]?), from qtpy | Set-Content $pyFilePath -Encoding UTF8Write-Host Files have been converted and modified successfully: $pyFile}else{Write-Host convert failed: $uiFile} }如果你的项目是有结构的比如下图 需要将ui转出的py文件放置到上层的ui目录中的话可以修改以下内容 添加父文件夹$parentDirectory Split-Path -Parent $scriptDirectory # Gets the folder where the current script is located $scriptDirectory Split-Path -Parent $MyInvocation.MyCommand.Definition $parentDirectory Split-Path -Parent $scriptDirectory# Perform conversion operations for all *.ui files in the folder Get-ChildItem -Path $scriptDirectory -Filter *.ui | ForEach-Object {$uiFile $_.FullName$pyFile $_.BaseName .py$pyFilePath Join-Path $parentDirectory (ui/ $pyFile)PS qrc转py同理 可以看看另一篇文章 qrc2py
http://www.dnsts.com.cn/news/11550.html

相关文章:

  • 设计网站用什么语言机构改革网站建设
  • 网站备案查询官网入口深圳网站建设哪里便宜
  • 做网站的尺寸1920外行做网站
  • 网站建设好发信息网wordpress 闪图不
  • 广州市住房与城乡建设部网站网站建设怎么做帐
  • 怎样建网站 步骤天津做大健康的公司
  • 网站建设与制作与维护ppt自己怎么在网上开店
  • 我做的网站不能往下拉北京网站建设分析论文
  • 京东 推广网站怎么做天眼查企业查询入口官网
  • 淄博企业网站建设有限公司虚拟物品网站制作模板
  • 上海的建设项目招投标在哪个网站山西网架公司
  • 网站怎么做抽奖小学网站模板免费下载
  • 中国做室内设计的网站精美免费ppt模板下载
  • 深圳网站建设服务器手机网站弹出导航菜单
  • 天津网站建设哪家公司好家居建材网站源码
  • 用html框架做网站seo招聘的关键词
  • 做电商网站的感想网站群 意义
  • 单品商城网站源码广州 网站制作公司 网络服务
  • 郑州网站优化平台成都网站建设益友网络
  • 赣州有做网站推广的公司吗互联网公司排名2023
  • 布吉网站建设价格百度首页优化
  • 嘉兴网站建设技术开发建设银行网站用户
  • 爱站网做网站吗网络营销推广策划
  • 静态网站生成如何设计并制作各级网页
  • 在平台企业网站推广怎么做免费企业网站建设单位
  • 传奇网站怎么制作教程网站的技术方案
  • 网站前台登录模板wordpress源码最新
  • 做网站需要什么配置服务器做软件的声称发现网站漏洞
  • 瑞安网站建设优化磁力链最好用的搜索引擎
  • 做行政关注什么类型的网站wordpress编辑教程