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

网站开发培训深圳广州易网网站建设

网站开发培训深圳,广州易网网站建设,wordpress卡蜜主题,微信怎么自创小程序前言 由于需要使用不同的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.hkea.cn/news/14499768/

相关文章:

  • 大型网站外链是怎么建设的一键生成海报的网站
  • 线上网站开发相关书籍wordpress改模版
  • 网站建设和技术支持住房和城乡建设部网站干部学院
  • 加强网站人才建设十堰网站建设培训
  • 一定要用c 做网站吗周口城乡建设网站
  • 一个专门做字画的网站wordpress 禁止过滤
  • 网站恶意做评论梅县区住房和城乡规划建设局官方网站
  • 创建个人网站巨量关键词搜索查询
  • 网站icp备案证书wordpress通知邮件美化
  • 网站承建商有哪些如何 做镜像网站
  • 用什么软件快速做网站福田莲花北网站建设
  • 免费网站设计 优帮云优质企业网站建设
  • 网站开发实习计划模板在服务器网站上做跳转
  • 农业网站 源码怎么用ip地址做网站
  • 公司制作网站怎么做网站开发交流吧
  • 用PS怎么做网站图片视频网站采集规则
  • 广东建设厅网站做网站不签合同
  • 网站开发背景怎么写网站搭建与服务器配置
  • 门户网站集群建设方案12380网站建设总结
  • 网站右侧二维码代码wordpress 登陆验证码
  • 将网站制作成app辽宁省建设工程新希望官网
  • 两人做性视频网站什么是网站解决方案
  • asp.net网站开发期末复习题摄影课程自学网站
  • 网站建设编程时注意事项网站开发开票编码归属
  • 如何删除自己建的网站服务器调用wordpress
  • 网广州建网站站制作没备案的网站收录
  • 网站未备案会怎么样网站服务器好
  • 网站界面怎么做网站注册商是什么
  • 银行网站维护是做哪些wordpress lazy load
  • 网上做名片的网站哈尔滨百度公司地址