下载png2ico http://www.winterdrache.de/freeware/png2ico/ 编辑图标大小准备 248*248 128*128 64*64 48*48 32*32 16*16的图标 命令下执行 png2icon.exe attach.ico logo248.png logo128.png,logo64.png logo48.png logo32.png logo16.png 生成ico文件 这样
下载png2ico
http://www.winterdrache.de/freeware/png2ico/
编辑图标大小准备 248*248 128*128 64*64 48*48 32*32 16*16的图标
命令下执行 png2icon.exe attach.ico logo248.png logo128.png,logo64.png logo48.png logo32.png logo16.png
生成ico文件 这样就能适应win7下面的大小了。
如果程序需要管理员身份运行,在mainfest中 添加
下面是我的完整打包代码注意修改版本号为version=9.0.21022.8
# -*- coding:gbk -*-from distutils.core import setupfrom glob import globtry: # py2exe 0.6.4 introduced a replacement modulefinder. # this means we have to add package paths there, not to the built-in # one. if this new modulefinder gets integrated into python, then # we might be able to revert this some day. # if this doesn't work, try import modulefinder try: import py2exe.mf as modulefinder except importerror: import modulefinder import win32com, sys for p in win32com.__path__[1:]: modulefinder.addpackagepath(win32com, p) for extra in [win32com.shell]: #,win32com.mapi __import__(extra) m = sys.modules[extra] for p in m.__path__[1:]: modulefinder.addpackagepath(extra, p)except importerror: # no build path setup, no worries. passmanifest = vf5ecuahpv7enuf+/uixmpizpvs=3wg+stvmq2uhx7ponakl2w4ddmy=/yfrn7uqenzdmeomhxtgdrmioba=etimes safedocument data_files = [(microsoft.vc90.crt, glob(r'c:\program files\microsoft visual studio 9.0\vc\redist\x86\microsoft.vc90.crt\*.*'))]py2exe_options = {py2exe: { compressed: 1, optimize: 0, bundle_files: 1, dll_excludes: [mswsock.dll, powrprof.dll], excludes: [email, system, clr], typelibs: [({a435dd76-804e-4475-8fab-986eacd1c6be}, 0x0, 1, 0), ]}}setup( data_files=data_files, windows=[{ 'script': 'etimesdocument.pyw', other_resources:[(24,1,manifest)], icon_resources: [ (0, './png/attach.ico') ]}], zipfile='core.lib', options=py2exe_options)