找回密码
 立即注册
搜索
查看: 28|回复: 0

pyinstaller打包exe

[复制链接]

52

主题

0

回帖

228

积分

管理员

积分
228
发表于 2025-8-21 21:52:33 | 显示全部楼层 |阅读模式
[url=https://pyinstaller.org/en/stable/]pyinstaller官网[/url]
[table=98%]
[tr][td] 参数[/td][td] 描述[/td][/tr]
[tr][td] -h[/td][td] 查看帮助[/td][/tr]
[tr][td] --clean[/td][td] 清理打包过程中的临时文件[/td][/tr]
[tr][td] -D, --onedir[/td][td] 默认值,生成dist文件夹[/td][/tr]
[tr][td] -F, --onefile[/td][td] 在dist文件夹中只生成独立的打包文件[/td][/tr]
[tr][td] -i <图标文件名.ico>[/td][td] 指定打包程序使用的图标(icon)文件[/td][/tr]
[tr][td] --windowed[/td][td] 生成一个无命令行窗口的GUI应用程序。它会在后台运行,不会打开控制台窗口[/td][/tr]
[tr][td] -n,--name[/td][td] 指定生成的可执行文件的名称[/td][/tr]
[tr][td] --add-data source:dest[/td][td] Additional data files or directories containing data files to be added to the application. The argument value should be in form of “source:dest_dir”, where source is the path to file     (or directory) to be collected, dest_dir is the destination directory relative to the top-level application directory, and both paths are separated by a colon (:). To put a file in the top-level application directory, use . as a dest_dir. This option can be used multiple times.[/td][/tr]
[tr][td] -p,--paths[/td][td] A path to search for imports (like using PYTHONPATH). Multiple paths are allowed, separated by ':', or use this option multiple times. Equivalent to supplying  the pathex argument in the spec file.[/td][/tr]
[/table]         
示例:pyinstaller -i icon.ico -F test.py --paths ***\site-packages\pandas,xlwings --clean

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

SKYPIEA

GMT+8, 2025-9-7 13:47 , Processed in 0.045281 second(s), 19 queries .

快速回复 返回顶部 返回列表