我希望能够右键单击我用python制作的.exe并转到属性并查看文件版本,产品名称,文件描述等。如何使用python显示这些属性?
答案 0 :(得分:0)
我终于能够解决问题,并通过在我的设置文件中添加一些内容来添加属性详细信息。这就是它的样子:
from distutils.core import setup
import py2exe, sys, os
if len(sys.argv) == 1:
sys.argv.append("py2exe")
sys.argv.append("-q")
class Target:
def __init__(self, **kw):
self.__dict__.update(kw)
self.version = "2.0.0.1"
self.company_name = "CompanyName"
self.copyright = "Copyright (c) 2015 CompanyName"
self.name = "FileName"
target = Target(
description = "FileDescription",
script = "Script.py",
dest_base = "ProgramName")
setup(
options = {'py2exe': {'bundle_files': 2,
'compressed': True}},
zipfile = None,
windows = [target]
)