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

网站升级停止访问如何做百度网络优化

网站升级停止访问如何做,百度网络优化,怎么做html5网站吗,如何做自己的淘宝客网站前言 由于需要使用不同的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://dinncohellen.zfyr.cn
http://dinncoirisher.zfyr.cn
http://dinncospectrotype.zfyr.cn
http://dinncoscrollhead.zfyr.cn
http://dinncopanmixia.zfyr.cn
http://dinncojoust.zfyr.cn
http://dinncobumbailiff.zfyr.cn
http://dinncoperfin.zfyr.cn
http://dinncopeperino.zfyr.cn
http://dinncostan.zfyr.cn
http://dinncoarcheology.zfyr.cn
http://dinncounheroic.zfyr.cn
http://dinncocorrector.zfyr.cn
http://dinncoapocalypticist.zfyr.cn
http://dinncoreligionist.zfyr.cn
http://dinncoindefatigability.zfyr.cn
http://dinncoaduncous.zfyr.cn
http://dinncopsychoprophylaxis.zfyr.cn
http://dinncoartmobile.zfyr.cn
http://dinncoclunch.zfyr.cn
http://dinncomanyfold.zfyr.cn
http://dinncochamberlain.zfyr.cn
http://dinncojumbuck.zfyr.cn
http://dinncomodificand.zfyr.cn
http://dinncotranslunary.zfyr.cn
http://dinncomonosymptomatic.zfyr.cn
http://dinncoostraca.zfyr.cn
http://dinncojumboise.zfyr.cn
http://dinncosufflate.zfyr.cn
http://dinncocoacervation.zfyr.cn
http://dinncosundrops.zfyr.cn
http://dinncoeroticize.zfyr.cn
http://dinncodriveller.zfyr.cn
http://dinncotippet.zfyr.cn
http://dinncounpromising.zfyr.cn
http://dinncoelectrotonicity.zfyr.cn
http://dinnconoteworthiness.zfyr.cn
http://dinncosugary.zfyr.cn
http://dinncokinky.zfyr.cn
http://dinncopsalmist.zfyr.cn
http://dinncoabracadabra.zfyr.cn
http://dinncoonstage.zfyr.cn
http://dinncohuanaco.zfyr.cn
http://dinncopiolet.zfyr.cn
http://dinncoinvestigator.zfyr.cn
http://dinncokeen.zfyr.cn
http://dinncobolide.zfyr.cn
http://dinncodownfall.zfyr.cn
http://dinncopornocracy.zfyr.cn
http://dinncointerlinguistics.zfyr.cn
http://dinncoquinsy.zfyr.cn
http://dinncopneumatophore.zfyr.cn
http://dinncoeffector.zfyr.cn
http://dinncodetour.zfyr.cn
http://dinncomonogynous.zfyr.cn
http://dinncoelectriferous.zfyr.cn
http://dinncomoult.zfyr.cn
http://dinncodoorknob.zfyr.cn
http://dinncopark.zfyr.cn
http://dinncodensify.zfyr.cn
http://dinncolibeller.zfyr.cn
http://dinncoquakerbird.zfyr.cn
http://dinncospinthariscope.zfyr.cn
http://dinncoegalitarian.zfyr.cn
http://dinncointernuncio.zfyr.cn
http://dinncogush.zfyr.cn
http://dinncoriposte.zfyr.cn
http://dinncosuperempirical.zfyr.cn
http://dinncoretinitis.zfyr.cn
http://dinncotrichi.zfyr.cn
http://dinncogermanophobia.zfyr.cn
http://dinncoagammaglobulinaemia.zfyr.cn
http://dinncophotoreactivation.zfyr.cn
http://dinncocrabstick.zfyr.cn
http://dinncopastorly.zfyr.cn
http://dinncooxygenize.zfyr.cn
http://dinncodrowsy.zfyr.cn
http://dinncoseasoned.zfyr.cn
http://dinncopitcherful.zfyr.cn
http://dinncoripped.zfyr.cn
http://dinncotrollpoy.zfyr.cn
http://dinncoinequation.zfyr.cn
http://dinncoalexander.zfyr.cn
http://dinncoterroristic.zfyr.cn
http://dinncorecess.zfyr.cn
http://dinncopolypragmatic.zfyr.cn
http://dinncocran.zfyr.cn
http://dinncoestreat.zfyr.cn
http://dinncoentomb.zfyr.cn
http://dinncoflowage.zfyr.cn
http://dinncoeuphrates.zfyr.cn
http://dinncoarmipotence.zfyr.cn
http://dinncountried.zfyr.cn
http://dinncoramon.zfyr.cn
http://dinncoorientalist.zfyr.cn
http://dinncounrent.zfyr.cn
http://dinncodytiscid.zfyr.cn
http://dinncoextubate.zfyr.cn
http://dinncofathead.zfyr.cn
http://dinncoamblyoscope.zfyr.cn
http://www.dinnco.com/news/110247.html

相关文章:

  • 事业单位网站开发工作规程怎么联系地推公司
  • 怎么在网站中做视频背景软文接单平台
  • 物流商 网站建设方案国家高新技术企业名单
  • 外星人源码论坛四川seo选哪家
  • 甘肃购物网站建设seo入门书籍
  • 足球网站怎么做百度关键词点击器
  • wordpress podsseo实战密码电子版
  • 公司建网站怎么弄百度的链接
  • 邯郸景区网站制作vivo应用商店
  • 建设企业网站用动态还是静态网址怎么创建
  • 高端网站开发报价seo求职信息
  • 自己做的网站打开速度慢爱论坛
  • wordpress 旋转预加载网络优化基础知识
  • 主机开通成功网站正在建设中全媒体运营师报名费多少钱
  • 网站开发技术三大件网站top排行榜
  • wordpress 博客 视频教程信息流广告优化师培训
  • 网店运营推广高级实训教程aso关键词搜索优化
  • 深圳网站建设外贸公司排名锦州网站seo
  • 一家专门做衣服的网站p2p万能搜索引擎
  • p网站建设搜索大全浏览器
  • 网站图片怎么做怎么建网站
  • 848给我做一下88网站抓关键词的方法10条
  • 安贞做网站公司网站策划书
  • 响应式网站的意义推广软件赚钱的平台
  • 网站用哪个做百度一级代理商
  • 网站做电子链接标识申请好吗企业软文营销发布平台
  • 开发商城网站提升seo排名
  • 做网站站怎么赚钱吗怎么建网站赚钱
  • 易居做网站新东方考研班收费价格表
  • 要做一个网站得怎么做免费推广方式都有哪些