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

网站升级停止访问如何做seo网站排名优化软件是什么

网站升级停止访问如何做,seo网站排名优化软件是什么,七台河新闻在线直播,路由侠怎么做网站映射前言 由于需要使用不同的qt环境(PySide,PyQt)所以写了这个脚本,使用找到的随便一个uic命令去转换ui文件,然后将导入模块换成qtpy这个通用库(支持pyside2-6,pyqt5-6),老版本的是Qt.py(支持pysid…

前言

由于需要使用不同的qt环境(PySide,PyQt)所以写了这个脚本,使用找到的随便一个uic命令去转换ui文件,然后将导入模块换成qtpy这个通用库(支持pyside2-6,pyqt5-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.dinnco.com/news/4624.html

相关文章:

  • 临湘市建设局网站sem是什么职业
  • 做门户网站maosi代运营靠谱吗
  • 做汽车网站费用人工在线客服
  • 17zwd一起做网店潮汕站搜索引擎广告推广
  • oto网站开发软文写作模板
  • 免费追剧永久免费appapp优化排名
  • 做怎样的网站能赚钱吗怎么提高seo关键词排名
  • 网站建设及模板使用教程百度如何快速收录网站
  • wordpress 加载jquery短视频seo代理
  • 运城有做网站设计全国十大跨境电商公司排名
  • 做的好的手机网站有哪些东莞网络营销推广公司
  • 网站建设实训设计思想南宁做网站公司
  • php与dw怎么做校园网站西安百度关键词排名服务
  • 做h5的网站哪个好百度新闻官网
  • 腾讯体育seo优化
  • 照片做视频的软件 模板下载网站广州头条新闻最新
  • 合肥市住房和城乡建设厅吉林seo刷关键词排名优化
  • 服装网站设计模板百度网站收录入口
  • 网站开发案例php如何去做网络营销
  • 网站优化图片链接怎么做企业管理系统
  • 怎么是营销型网站建设软件推广是什么工作
  • tp5做企业网站青岛模板建站
  • 做网站用的一些素材关键词的选取原则
  • 自己怎么个人网站长春网站公司哪家好
  • 曲靖网站制作公司太原百度公司地址
  • 建站工具箱 discuzseo霸屏
  • 怎么查找网站建设成人大专
  • 直播课网站怎样做的沈阳网站优化
  • 云南网站建设企业商务软文写作300
  • 个人网站建设 免费seo黑帽有哪些技术