如何制作具有良好图形效果的.exe for Python? [英] How to make a .exe for Python with good graphics?

查看:280
本文介绍了如何制作具有良好图形效果的.exe for Python?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Python应用程序,我决定执行一个.exe来执行它.

I have a Python application and I decided to do a .exe to execute it.

这是我用来执行.exe的代码:

This is the code that I use to do the .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运行应用程序时,图形却大不相同.

But when I run my application with the .exe, the graphics are quite different.

在下面的图像中,您可以看到该应用程序在左侧以python运行,在右侧以.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一样好?

How can I make the .exe one be as good as the one that runs thought python?

推荐答案

我假设您是指工具栏和按钮的视觉样式.您需要将清单文件添加到EXE文件或作为单独的文件,以便Windows应用最新comctl32.dll版本的现代风格.

I assume you mean the visual style of the toolbar and buttons. You need to add a manifest file to the EXE file or as a separate file so that Windows applies the modern style of recent comctl32.dll versions.

签出将Windows XP视觉样式与控件一起使用在Windows窗体上在MSDN上.阅读有关创建".exe.manifest"文件的相关部分.

Check out Using Windows XP Visual Styles With Controls on Windows Forms on MSDN. Read the relevant part about creating the ".exe.manifest" file.

可以在 wxPython网站上找到特定于py2exe的更多教程.他们介绍了如何使用setup.py包含必要的清单文件.

A more py2exe-specific tutorial can be found over at the wxPython site. They explain how to use setup.py to include the necessary manifest file.

这篇关于如何制作具有良好图形效果的.exe for Python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆