75MB地狱世界和py2app!

2024-03-28 14:48:20 发布

您现在位置:Python中文网/ 问答频道 /正文

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

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

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

发现我的地狱世界.app重量高达75 MB!!(那么我在运行时出现了一个错误,但这不是问题所在)

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

(一个Swing HelloWorld大约是3KB,而JRE大约是20MB)

谢谢你


Tags: 语言app应用程序helloworldwindowsmac错误
1条回答
网友
1楼 · 发布于 2024-03-28 14:48:20

我会非常感谢您使用PyINstaller,可以在这里找到:link

到目前为止,它对我来说就像一个chamr,它支持大多数主要的库: wxpythonpyqt甚至django(尽管我并不真正理解django支持的全部内容;-)

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.

我希望这有帮助,祝你好运,如果你还需要帮助,告诉我

相关问题 更多 >