[Python-Dev] hook for standalone executable

Jack Jansen Jack.Jansen at cwi.nl
Mon Aug 11 00:57:53 EDT 2003

On zaterdag, aug 9, 2003, at 07:34 Europe/Amsterdam, Mark Hammond wrote:
> * Propose a new executable that some Python platforms can choose to
> distribute - eg, 'python-package{.exe}'.  This is really just 
> identical to
> python.exe, but with the only 'if doesnt start with 'python'' parts of 
> your
> proposal.

Even though having the one Python interpreter fill a dual role is a hack
I still think you should try to go for it, and I say this from 

MacPython-OS9 has had applets (which is basically what you're after) 
since about
1.3 or 1.4. Initially, applets had a special main program. At some 
point I hacked
something up (now that I think about it it may not have been me, it may 
been Just who did it) so that the two main programs were united, and 
really made life a lot simpler and less error-prone.

On the Mac life was easy, though, because of the resource fork. The main
program simply started with
    if (there's a 'PYC ' resource named '__main__')
       I'm an applet;
       I'm a normal interpreter;

But: now that I'm thinking this whole idea through a little bit: if this
is all meant for packaging applications, how are you going to handle 
modules? These can't be put into zipfiles, or can they?

(Again, MacOS had a neat hack for this: you could put multiple shared 
and executables and more into a single file. But I don't think you can 
that one most systems).
- Jack Jansen        <Jack.Jansen at oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -

More information about the Python-Dev mailing list