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

兼职做ppt是哪个网站好百度推广开户公司

兼职做ppt是哪个网站好,百度推广开户公司,网络公司给别人做网站的cms是买的授权么,博客自定义网站前言 由于需要使用不同的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.khdw.cn/news/63894.html

相关文章:

  • 网站建设方案书个人seo专员是干什么的
  • 做网站要学的知识福州网站排名
  • 用户体验的互动展示网站网站交易
  • 上海网站建站模板易推客app拉新平台
  • 个体户做网站济南做seo的公司排名
  • 南昌专业做网站的今天最新新闻10条
  • 怎样建小型网站温州seo教程
  • 做机械出口用哪个网站好点击器 百度网盘
  • 房屋装修效果图片欣赏惠州seo
  • 如需武汉手机网站建设广告宣传网站
  • 分类信息网站开发需求方案西安网站维护
  • 贵阳市建设城乡规划局网站seo整站优化报价
  • 做网站需求文档抖音运营推广策划方案
  • 套路网站怎么做的搜狗官方网站
  • 网站备案现场百度快速排名
  • apache 多个网站查关键词排名软件
  • 青岛煜鹏网站建设公司海外营销方案
  • 做网站的电脑配置成品app直播源码有什么用
  • 自做网站图片版权搜索引擎优化排名优化培训
  • 莱芜网站优化加徽信xiala5效果好站长工具 站长之家
  • 网站建设找客户渠道潍坊网站建设平台
  • 网站风格设计怎么写windows优化大师和鲁大师
  • 广东网站建设推荐360优化大师下载官网
  • 做网站怎样盈利湖南网站建设营销推广
  • 企业网站案列河南靠谱seo地址
  • 淘宝客怎么自己做网站永久免费无代码开发平台网站
  • 陕西手机网站建设公司哪家好地推公司
  • wordpress挖北京seo关键词排名
  • 网站正在建设中是什么意思百度浏览器网址大全
  • 凸一品牌策划公司常宁seo外包