2

I'm testing different languages to developp a desktop application for Mac&Windows.

I thought that Python+Wx worth a try so I wrote a simple hello world.

Then, I tried the py2app to package my application as a Mac application.

What a surprise to find that my hellworld.app weight as much as 75 MB !! (then I have an error at runtime but that's not the question)

Here is my question : is there a way to distribute a standalone wxPython application that weight less than a few MB ? (for instance, an adress book app).

(a Swing HelloWorld is around 3KB, plus around 20MB for the JRE)

Thank you

user777466
  • 991
  • 2
  • 13
  • 21
  • 1
    Mo being megabytes (MB)? Or is this some new memory size unit? – Matt Ellen Jul 27 '11 at 11:14
  • Ah yes, Mo=MB, sorry. (in french we have Mo for "méga-octet", an "octet" is a byte) – user777466 Jul 27 '11 at 11:35
  • @user777466 An octet is **not** a byte (it *can* be one though). Octet means "a group of eight people or things" and byte means "a group of binary digits or bits operated on as a unit" according to Oxford Dictionary. –  Jul 27 '11 at 11:40
  • Just distribute it, most macs (I think all) ship with some form of python now. – Jakob Bowyer Jul 27 '11 at 11:40
  • 10
    @WTP - he did say in French http://dictionnaire.reverso.net/francais-definition/octet – Reuben Mallaby Jul 27 '11 at 11:42
  • 2
    Unfortunately distributing desktop applications is a weak point for Python. Pyinstaller and cx_Freeze are alternatives which say they have some mac support, but they may not be any better than py2app. – Thomas K Jul 27 '11 at 12:14
  • 2
    @WTP in french, octet="group of 8 bits" and it's specific to the computer area.But now I know I can say "what a nice octet" speaking about 8 birds in a tree ;) – user777466 Jul 27 '11 at 12:33
  • Have you tried importing only what you need? like from wxPython import x – thabubble Jul 27 '11 at 14:17
  • Yep, this is a fact of life using wxPython and Py2App. Not much you can do about that. – Rafe Kettler Jul 29 '11 at 12:47

1 Answers1

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

Community
  • 1
  • 1
cwoebker
  • 3,158
  • 5
  • 27
  • 43
  • That may or may not be a good thing depending on what releases and platforms you are targeting. On OS X it is generally considered best practice to, if necessary, trade a bit of (cheap) disk space for the security of supplying exactly what you need within your app bundle to ensure a predictable and simple user experience. That can be difficult (not impossible) to do if you rely on the OS X system Pythons across multiple releases. – Ned Deily Jul 29 '11 at 21:13
  • thats why i said, you don't have to, but you still can:-) – cwoebker Jul 29 '11 at 23:08
  • 1
    Well, you don't have to bundle python with py2app either, if you are willing to live with the same restrictions. – Ned Deily Jul 29 '11 at 23:27
  • Tx for this answer, I tried it and worked good. But I moved with Java for my project. Better developpment environment. – user777466 Aug 02 '11 at 10:42