在使用py2exe编译python程序时如何使用我的图标?

时间:2022-09-17 07:14:50

I don't know what commands to enter into the setup.py file when compiling a python program to use my icons. Can anyone help me? Thanks in advance.

在编译python程序以使用我的图标时,我不知道输入setup.py文件的命令。谁能帮我?提前致谢。

2 个解决方案

#1


5  

from distutils.core import setup
import py2exe
setup(
        windows=[{"script": 'app.py', "icon_resources": [(1, "icon.ico")]}],
        options={"py2exe":{"unbuffered": True,
                        "optimize": 2,
                        "bundle_files" : 1,
                        "dist_dir": "bin"}},
                        zipfile = "lib.zip", 
)

#2


4  

I haven't tried this, but here's a link I found:

我没有试过这个,但这里有一个我发现的链接:

http://www.py2exe.org/index.cgi/CustomIcons

#1


5  

from distutils.core import setup
import py2exe
setup(
        windows=[{"script": 'app.py', "icon_resources": [(1, "icon.ico")]}],
        options={"py2exe":{"unbuffered": True,
                        "optimize": 2,
                        "bundle_files" : 1,
                        "dist_dir": "bin"}},
                        zipfile = "lib.zip", 
)

#2


4  

I haven't tried this, but here's a link I found:

我没有试过这个,但这里有一个我发现的链接:

http://www.py2exe.org/index.cgi/CustomIcons