除了使用资源编辑器外,您还可以使用 PyInstaller 的命令行选项来添加描述信息。在打包 Python 代码时,使用 `--version-file` 选项来指定一个包含描述信息的版本文件。
以下是一个版本文件的示例:文章源自爱尚资源教程网-https://www.23jcw.net/6462.html
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(1, 0, 0, 0),
prodvers=(1, 0, 0, 0),
mask=0x3f,
flags=0x0,
OS=0x40004,
fileType=0x1,
subtype=0x0,
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'040904b0',
[
StringStruct(u'CompanyName', u'My Company'),
StringStruct(u'FileDescription', u'My Program'),
StringStruct(u'FileVersion', u'1.0.0.0'),
StringStruct(u'InternalName', u'myprogram'),
StringStruct(u'LegalCopyright', u'Copyright (C) 2021'),
StringStruct(u'OriginalFilename', u'myprogram.exe'),
StringStruct(u'ProductName', u'My Program'),
StringStruct(u'ProductVersion', u'1.0.0.0')
]
)
]
),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
)
在版本文件中,您可以指定公司名称、文件描述、版权信息、产品名称等信息。将版本文件保存为 `myversion.py`,然后使用以下命令打包 Python 代码:文章源自爱尚资源教程网-https://www.23jcw.net/6462.html
```
pyinstaller --onefile --version-file=myversion.py myscript.py
```文章源自爱尚资源教程网-https://www.23jcw.net/6462.html
这将生成一个包含描述信息的 EXE 文件。文章源自爱尚资源教程网-https://www.23jcw.net/6462.html
希望这些信息对您有所帮助。文章源自爱尚资源教程网-https://www.23jcw.net/6462.html 文章源自爱尚资源教程网-https://www.23jcw.net/6462.html
相关文章
版权声明:文章图片资源来源于网络,如有侵权,请留言删除!!!
