link vs import

Alex Martelli aleaxit at yahoo.com
Fri May 25 09:46:07 EDT 2001


"Brian Rowe" <roweb004 at hawaii.rr.com> wrote in message
news:wmrP6.6041$WI.2004620 at typhoon.hawaii.rr.com...
> Hello,
>
> I've got a program that imbeds the python interpreter.  I have also made
> an extension module, so the scripts can call funcitions within my
> program.  I would like to know if the python interpreter will have access
> to this module if I link it into my program at compile time (vice doing an
> import from within the interpreter at run time).
>
> If there is a way to allow it to have access, then how do you do it?

PyImport_AppendInittab will let you add your module to the
table of "built-in" modules.  PyImport_ImportModule lets
you "load" it.  You may then place an entry for it in
module '__builtin__' or wherever you wish.  Is that what
you mean...?


Alex






More information about the Python-list mailing list