我有一个 Python 应用程序,我决定创建一个 .exe 来执行它。
这是我用来执行 .exe 的代码:
# -*- coding: cp1252 -*-
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "SoundLog.py"}],
zipfile = None,
packages=[r"C:\Users\Public\SoundLog\Code\Código Python\SoundLog\Auxiliar", r"C:\Users\Public\SoundLog\Code\Código Python\SoundLog\Plugins"],
)
但当我使用 .exe 运行应用程序时,图形却截然不同。
In the image bellow you can see the application running thought python at the left and running thought the .exe at the right.
如何使 .exe 与运行 python 的一样好?
我假设您指的是工具栏和按钮的视觉样式。您需要将清单文件添加到 EXE 文件或作为单独的文件,以便 Windows 应用最新 comctl32.dll 版本的现代风格。
查看将 Windows XP 视觉样式与 Windows 窗体上的控件结合使用 http://msdn.microsoft.com/en-us/library/aa289524%28VS.71%29.aspx在 MSDN 上。阅读有关创建“.exe.manifest”文件的相关部分。
可以在以下位置找到更多特定于 py2exe 的教程wxPython 站点 http://wiki.wxpython.org/DistributingYourApplication。他们解释了如何使用 setup.py 包含必要的清单文件。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)