Pyinstaller打包Python代码为.exe,多个.py文件和多模块打包_Ethan的博客-程序员宅基地_pyinstaller打包多个py文件

Pyinstaller打包Python代码为.exe,多个.py文件和多模块打包_Ethan的博客-程序员宅基地_pyinstaller打包多个py文件

技术标签: Pyinstaller打包教程

文件结构testentrance.pyclip.pydata.pyunet.dbaccd.xmlreason.csv多个.py文件和多个打包命令格式如下:

`pyinstaller [主文件] -p [其他文件1] -p [其他文件2] –hidden-import [自建模块1] –hidden-import [自建模块2]

根据上面的文件结构打包命令如下

pyinstaller -F entrance.py -p clip.py -p data.py --hidden-import clip --hidden-import data

注意:其中entrance.py是主程序入口文件,其他.py文件是自建模块,需要在主文件中使用,仅打包.py文件其余依赖项只需在打包完成后,将它们放在打包后生成的.exe文件的同一个目录下即可

image-20211023051700876

image-20211023051633817


Pyinstaller打包Python代码为.exe,多个.py文件和多模块打包_Ethan的博客-程序员宅基地_pyinstaller打包多个py文件
http://example.com/2021/10/23/Pyinstaller打包Python代码为-exe,多个-py文件和多模块打包-Ethan的博客-程序员宅基地-pyinstaller打包多个py文件/
作者
MuyanGit
发布于
2021年10月23日
许可协议