在我使用 cx_freeze 冻结它(我正在使用 Gui2Exe 创建和运行 cx_freeze 脚本)以及使用 python 解释器运行它时,我的应用程序看起来不同了。
[因为我不允许发布图像,这里是 UI 的链接,编辑?]
脚本运行:
冻结运行:
我已经尝试在 cx_freeze 脚本中包含和不包含清单文件,但我不确定是什么导致应用程序 UI 发生如此巨大的变化。
这是 cx_freeze 脚本:
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.3
# Copyright: (c) 2007-2012 Andrea Gavana
# ======================================================== #
# Let's start with some default (for me) imports...
from cx_Freeze import setup, Executable
# Process the includes, excludes and packages first
includes = ['ast', 'gobject', 'gtk']
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
'Tkconstants', 'Tkinter']
packages = ['BeautifulSoup', 'mechanize', 'pygtk']
path = []
# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.
# No custom code added
# The setup for cx_Freeze is different from py2exe. Here I am going to
# use the Python class Executable from cx_Freeze
GUI2Exe_Target_1 = Executable(
# what to build
script = "moodle-downloader.py",
initScript = None,
base = 'Win32GUI',
targetDir = r"md",
targetName = "moodle-downloader.exe",
compress = True,
copyDependentFiles = True,
appendScriptToExe = True,
appendScriptToLibrary = True,
icon = r"C:\Users\Nasser.Al-Hilal\Dropbox\CodeN\Projects\Applications\Personal\MoodleDownloader\res\md.ico"
)
# That's serious now: we have all (or almost all) the options cx_Freeze
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.
setup(
version = "0.3",
description = "An app to assist in downloading assignment submissions from Moodle LMS.",
author = "Nasser Al-Hilal",
name = "Moodle Downloader",
options = {"build_exe": {"includes": includes,
"excludes": excludes,
"packages": packages,
"path": path
}
},
executables = [GUI2Exe_Target_1]
)
# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.
# No post-compilation code added
# And we are done. That's a setup script :-D
如果我能让应用程序看起来与从解释器运行时相同,我会更喜欢。