[wxPython-users] Cross-platform distribution

Dusty Phillips buchuki at gmail.com
Mon Oct 1 13:21:57 PDT 2007


> > I'm trying to figure out a better way to ship extra so called
> > "resource" files with my wxPython-based application such that they can
> > be accessed in a cross-platform manner.
>
> > I currently use distutils rather clumsily and place these files in the
> > data_files array:
>
> distutils is really designed for distributing packages, rather than
> applications. That is, essentially libraries that folks will use to
> build their own apps.
>
> For distributing applications, you're better off with Py2exe on Windows,
> Py2App on OS-X (those two are pretty compatible), and probably a regular
> old tarball for Linux (or maybe PyInstaller). If you want to make things
> really nice for Linux users, you'd build an rpm, and deb, and .....
>
> Anyway, at least py2app and Py2exe have, I think, a standard place to
> put data files.

Hmm. I've been reluctant to use Py2exe, as I understand that it ships
wxPython with the app. Maybe that's normal for Windows, but it seems
more sensible to me to download and install it once separately than to
have a large download with each app. I will experiment with it a bit
though. It looks like Py2exe is actually a distutils module, rather
than distinct from it, so I should theoretically be able to use it
without rearranging my linux installation stuff.

> Another option is to make your "resources" python files instead. img2py
> is a script distributed with wxPython that turns various image types
> into python source code, and virtually any other type of data could be
> serialized in a similar way, I'm sure. I like this approach, it makes
> things pretty darn clean.
>  > I
> > don't know what happens on a Mac and I'm not in a position to worry
> > about it until a Mac user becomes interested in my software
>
> I'm an interested Mac user -- at least if you're still working on
> meeting Robin's "give me a way for me to leave Emacs" challenge.

Yup. I have your "multiple top-level windows" in svn... that's why I'm
trying to figure out how to make a more user-friendly release now. I
haven't got "multiple views of the same buffer" yet; that's for 0.7.
I've had it before though, but took it out when I switched to wx.aui;
it shouldn't be too hard.

So if I created a py2exe version of distutils you would probably be
able to make it work using py2app?

> > I don't know how to reliably access these paths under wxPython.
> > wx.StandardPaths returns /usr/share/pallavi under Linux ...
>
> Right. The problem is that wx.StandardPaths and distutils are totally
> unrelated. I suppose you could use wx.StandardPaths in your setup.py
> file, as there wouldn't be much point in anyone running it without wx
> installed anyway.
>
> if you do want to use distutils, this may be helpful:
>
> http://wiki.python.org/moin/DistutilsInstallDataScattered
>
> (the Wiki seems to be down for the moment, so I'm not sure how helpful
> that may be, I found the link in the matplotlib setup.py -- it uses a
> lot of data files)

still down, I'll take a look later.

Thanks!

Dusty




More information about the wxpython-users mailing list