[Pythonmac-SIG] MacPython under OS/9 and OS/X - full installation required for embedded apps?

Jack Jansen Jack.Jansen@oratrix.com
Thu, 21 Nov 2002 22:14:37 +0100


On donderdag, nov 21, 2002, at 18:46 Europe/Amsterdam, Paul Miller 
wrote:

> On Windows, I can include the python DLL and some key python Lib files 
> and get a working interpreter (for embedded app use) without 
> installing all of Python.
>
> On Windows all you need to do is have the dll in the right place, and 
> point certain Python environment variables at the bundled Lib 
> directory, and it works.
>
> Is something like this possible on Mac? Has anyone ever done it?

With MacPython 2.2 (and its future successor, MacPython-OS9 2.3) this 
is possible. And it can even be done better than on Windows:-)

Look at the tricks BuildApplication uses: it combines PythonInterpreter 
plus PythonCore plus all needed extension modules plus "PYC " resources 
for all needed python modules into a single executable. For your 
application you would have to modify BuildApplication to use your app 
as the base app, in stead of PythonInterpreter.

If you want things to look exactly the same as on Windows (for ease of 
maintainance or some such reason) that's also possible (and even 
easier). Drop PythonCore into the extensions folder or into the folder 
where your application lives. Drop your embedding application on 
EditPythonPrefs and you can set a complete set of preferences for 
Python for that application only.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -