executab上的Python文件提取器

2024-10-04 01:33:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我用pythonPyInstaller构建了一个可执行文件,需要 当我执行可执行文件时,在可执行文件中保留一些文件 将其他文件提取到特定路径,如安装 特定文件夹中的包。在

我已经做了以下事情

  pyinstaller -F --add-data 'installation.zip:installation.zip' --onefile

但我不知道如何在可执行文件中将zip文件解压缩到 目的地。在


Tags: 文件路径文件夹add可执行文件datainstallationzip
1条回答
网友
1楼 · 发布于 2024-10-04 01:33:59

我使用以下代码创建了exe

pyinstaller -F  add-data "installation.zip;installation" phpfilescopy_extract.py  console  onefile

I have done extracting the zip file using this following code. sys._MEIPASS - gives the temporary exe extraction path that i used to locate the zip files and extracted from the path

^{pr2}$

相关问题 更多 >