writing extension in C++ for MacPython

Greg Ewing greg.ewing at compaq.com
Tue Dec 21 10:18:11 EST 1999


Henrik Ravn wrote:
> 
> Hi all,
> 
> I'm trying to run an interpreter instance from a C++ program. Everything
> works fine on the PC, but on the Mac I get as far as Py_Initialize() and
> boink, program exit. The stand-alone Python interpreter works fine.

I seem to remember having a problem like that once. I can't remember
all the details, but it turned out that Py_Initialize wasn't doing
everything necessary to initialise the Mac version of the interpreter.
I think it had something to do with getting hold of the reference
number of the application's resource fork and stashing it where the
interpreter can find it.

Take a look at the source of the main program for the stand-alone
interpreter and find out what it does to fire up the PythonCore,
then do likewise in your program.

Someone should probably report this to the maintainer of Mac
Python as a bug.

Greg



More information about the Python-list mailing list