python加图标打包不显示_Py2exe 打包后图标不显示[转载]

#-*- coding:gbk -*-

from distutils.core importsetupfrom glob importglobtry:#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:importpy2exe.mf as modulefinderexceptImportError:importmodulefinderimportwin32com, sysfor 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)exceptImportError:#no build path setup, no worries.

passmanifest= """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

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

)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值