2

我正在测试不同的语言来开发适用于 Mac 和 Windows 的桌面应用程序。

我认为 Python+Wx 值得一试,所以我写了一个简单的 hello world。

然后,我尝试使用 py2app 将我的应用程序打包为 Mac 应用程序。

发现我的 hellworld.app 重量高达 75 MB 真是令人惊讶!(然后我在运行时出错,但这不是问题)

这是我的问题:有没有办法分发重量小于几 MB 的独立 wxPython 应用程序?(例如,地址簿应用程序)。

(一个 Swing HelloWorld 大约 3KB,加上 JRE 大约 20MB)

谢谢

4

1 回答 1

3

I would highly remmoend you using PyINstaller, which can be found here: link

it works like a chamr for me so far and it support most of the major libraries: wxpython pyqt and even django (although i dont really understand the whole django support thing ;-) )

PyInstaller is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, and Mac OS X. Its main advantages over similar tools are that PyInstaller works with any version of Python since 2.2, it builds smaller executables thanks to transparent compression, it is fully multi-platform, and use the OS support to load the dynamic libraries, thus ensuring full compatibility.

The main goal of PyInstaller is to be compatible with 3rd-party packages out-of-the-box. This means that, with PyInstaller, all the required tricks to make external packages work are already integrated within PyInstaller itself so that there is no user intervention required. You'll never be required to look for tricks in wikis and apply custom modification to your files or your setup scripts. As an example, libraries like PyQt, Django or matplotlib are fully supported, without having to handle plugins or external data files manually. Check our compatibility list of SupportedPackages.

i hope this helps, good luck and tell if you need anymore help

于 2011-07-29T12:27:26.520 回答