crossplatform py2exe - would it be useful?

Thomas Heller theller at python.net
Fri Aug 8 15:52:45 EDT 2003


bokr at oz.net (Bengt Richter) writes:

> PMJI, since I haven't read all the prior thread, but if the point is
> just to have an executable that self-unpacks and starts, IWT the safest
> (for platform independence -- not security, see my conclusion later below)
> approach would be to have a tool that makes a light-weight self-unpacking
> "exe" wrapper for any/each platform.

No, that's not the goal (at least not for me). I don't want to unpack
something at runtime, I want exactly that what py2exe currently does:
One executable, plus maybe a handful of files (.dll/.pyd/.so).

> I think it would be relatively trivial on win32. I think you could do it all
> in Python once you have a little C boilerplate exe template compiled and a
> few special locations and segments defined (i.e., .exe's have provision
> for simple embedded resource entities.

Well, for PE files on win32, the special locations can easily be stored
as resources, but IIUC that's not possible under Linux, for example.
But appending random stuff at the end of a valid executable is possible there.

> For that purpose, I've been thinking a unicode utf-8 representation of
> an rfc2822 header might be cool.

Ok, once you can execute Python code, you can do very fancy stuff. But
the problem is to 'boot' the Python interpreter into existance, the
first setp of this must be done from C code, and so it must be as simple
as possible.

Thomas




More information about the Python-list mailing list