PyInstaller是一个将Python脚本转换为可执行文件的工具,它可以在Ubuntu系统下使用
-n:指定生成的可执行文件的名称。例如:pyinstaller -n my_executable script.py。-w:不显示控制台窗口。对于没有命令行输出的图形界面程序很有用。例如:pyinstaller -w script.py。-i:指定程序图标。例如:pyinstaller -i icon.ico script.py。-F:创建单个可执行文件。例如:pyinstaller -F script.py。-D:创建一个目录,包含可执行文件和相关文件。例如:pyinstaller -D script.py。-c:在控制台中显示程序输出。例如:pyinstaller -c script.py。--onefile:与-F相同,创建单个可执行文件。--onedir:与-D相同,创建一个包含可执行文件和相关文件的目录。--noconsole:与-w相同,不显示控制台窗口。--icon:与-i相同,指定程序图标。--name:与-n相同,指定生成的可执行文件的名称。--windowed:与-w相同,不显示控制台窗口。--add-data:添加额外的数据文件或目录。例如:pyinstaller --add-data "data.txt:." script.py。--add-binary:添加额外的二进制文件或目录。例如:pyinstaller --add-binary "my_library.so:." script.py。--hidden-import:隐式导入未在脚本中显式导入的模块。例如:pyinstaller --hidden-import=module_name script.py。--version-file:指定版本信息文件(.rc文件)。例如:pyinstaller --version-file=version_info.rc script.py。这些选项可以组合使用,以满足不同的打包需求。更多详细信息和选项,请参阅PyInstaller官方文档:https://pyinstaller.readthedocs.io/en/stable/usage.html