[Pythonmac-SIG] Can embed an extended Python module?

Jack Jansen Jack.Jansen@cwi.nl
Fri, 26 Jul 2002 10:21:50 +0200


On Thursday, July 25, 2002, at 06:54 , Sung Kim wrote:

> Can a C app embed a Python module, which itself imported a C glue 
> library? Thank you.

You have to be careful with your terminology here, because I have the 
feeling it matters (knowing that you've been posting Macho/CFM questions 
here).

The C app will embed the Python interpreter, not a Python module, unless 
you are doing something out of the ordinary. And the Python module will 
most likely have been linked to the glue library, not imported it.

If this is indeed what you wanted to ask ("Can a C app with an embedded 
Python interpreter import a module which was linked against a C glue 
library") then the answer is: yes, in principle there is no problem. 
There may however be a problem if the glue library expects a different 
runtime environment than what the embedding app uses (for example: on 
OS9 this will fail if the glue library is Carbon but the application is 
Classic).
--
- 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 -