视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
Py2exe打包后图标不显示
2020-11-09 07:46:20 责编:小采
文档


下载Png2Ico http://www.winterdrache.de/freeware/png2ico/ 编辑图标大小准备 248*248 128*128 * 48*48 32*32 16*16的图标 命令下执行 Png2Icon.exe Attach.ico logo248.png logo128.png,logo.png logo48.png logo32.png logo16.png 生成Ico文件 这样

下载Png2Ico

http://www.winterdrache.de/freeware/png2ico/

编辑图标大小准备 248*248 128*128 * 48*48 32*32 16*16的图标

命令下执行 Png2Icon.exe Attach.ico logo248.png logo128.png,logo.png logo48.png logo32.png logo16.png

生成Ico文件 这样就能适应win7下面的大小了。

如果程序需要管理员身份运行,在mainfest中 添加

 
	 
	 
	 
	 
	 

下面是我的完整打包代码

注意修改版本号为version="9.0.21022.8"

# -*- coding:gbk -*-
from distutils.core import setup
from glob import glob
try:
	# 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.
	pass

manifest = """


 
 
	
 
	
	
	
	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
)

下载本文
显示全文
专题