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

网站后台管理界面代码微信营销推广公司

网站后台管理界面代码,微信营销推广公司,小程序开发文档pdf,免费独立站建站平台有哪些说明: 自动获取当前根目录下所有py文件生成spec文件,直接运行pyinstaller进行打包即可。直接打包成单执行文件。 直接上代码 import ospathex []def recursion(path, main):if path[:1] ! /:path /listpath os.listdir(path)for item in listpath:if…

说明:

自动获取当前根目录下所有py文件生成spec文件,直接运行pyinstaller进行打包即可。直接打包成单执行文件。

直接上代码

import ospathex = []def recursion(path, main):if path[:1] != '/':path += '/'listpath = os.listdir(path)for item in listpath:if os.path.isdir(path + item):recursion(path + item, main)# print('文件夹',path +item)elif os.path.isfile(path + item):# if '.py' in item and '.pyc' not in item and '__init__' not in item and '.pyz' not in item and main not in item:if '.py' in item and all(i not in item for i in ['.pyc', '__init__', '.pyz','.pyd', main]):# print('文件',path +item)pathex.append(path + item)else:print('未知文件', path + item)def getTxt():return """# -*- mode: python ; coding: utf-8 -*-
block_cipher = Nonea = Analysis(['${thisMain}.py'],pathex=${thisPath},binaries=[],datas=[],hiddenimports=${thisPy},             runtime_hooks=[],excludes=[],win_no_prefer_redirects=False,win_private_assemblies=False,cipher=block_cipher,noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,cipher=block_cipher)
exe = EXE(pyz,a.scripts,a.binaries,a.zipfiles,a.datas,[],name='Main',debug=False,bootloader_ignore_signals=False,strip=False,upx=True,upx_exclude=[],runtime_tmpdir=None,console=True )"""if __name__ == '__main__':# 要使用pyinstaller打包的项目路径# path = 'E:/pythonProject/test1/pyqt'path = os.path.dirname(__file__)# 打包项目的入口文件名main = 'main'recursion(path, main)hiddenimports = []for i in pathex:if i != path:# print(i[:i.rindex('/')])hiddenimports.append(i.replace(i[:i.rindex('/')], '').replace(i[i.index('.'):], '').replace('/', ''))pathexs = []pathex.append(path)for i in pathex:if i != path:pathexs.append(i.replace(os.path.abspath(os.path.join(os.getcwd(), "../")), '').replace('/', '\\'))continuepathexs.append(i.replace('/', '\\'))outTxt = getTxt().replace("${thisPy}",f'{hiddenimports}').replace("${thisPath}",f'{pathexs}').replace("${thisMain}",main)with open(f"{path}/{main}.spec","w",encoding="utf-8")as f:f.write(outTxt)f.close()exit(0)

打包后的spec文件怎么使用?

直接在terminal窗口执行 pyinstaller 文件名.spec 然后回车即可

http://www.hkea.cn/news/356118/

相关文章:

  • 陕西省住房与城乡建设厅网站免费b站推广软件
  • 淮南市住房与城乡建设部网站网店买卖有哪些平台
  • 网页qq表情佛山百度快速排名优化
  • 网站建设方案论文1500社会新闻最新消息
  • 网站组建 需求分析市场监督管理局职责
  • 云课堂哪个网站做的好厦门关键词优化seo
  • 中企动力沈阳分公司seo免费诊断电话
  • 网站vps被黑湖人最新排名最新排名
  • 如何夸奖客户网站做的好seo课程心得体会
  • 有哪些做电子商务的网站时空seo助手
  • 临沂百度网站电脑培训机构哪个好
  • 无锡专业做网站的公司怎样把自己的产品放到网上销售
  • 大学网站建设管理办法推广技巧
  • 长春做网站公司seo关键词排名优化软件怎么选
  • 网站开发未按合同约定工期完工seo关键词排名怎么提升
  • 创可贴app海报制作网站百度seo优化方法
  • 龙岗品牌网站建设2024年新闻摘抄
  • 南阳住房和城乡建设厅网站招聘网站排名
  • 如何做网站活动封面建站的公司
  • 温州网站建设培训营销推广方案包括哪些内容
  • 厦门 建网站商业软文案例
  • wordpress读者墙站长之家seo工具包
  • 网站建设哪家好灵活苏州久远网络北京搜索引擎关键词优化
  • 网站优化怎么做 有什么技巧东莞seo建站
  • 什么网站可以做游戏机疫情最新数据消息
  • 企业网站开发报价单巩义网络推广
  • 网站开发技术交流群免费域名申请网站
  • 手机网站一键分享怎么知道自己的域名
  • 做网站 做好把我踢开北京网站搭建哪家好
  • 网站如何做引流刷外链网站