Tricky interpreter initialization question..

Martin von Loewis loewis at informatik.hu-berlin.de
Wed Jan 12 15:17:26 EST 2000


"Jason Maskell" <backov at nospam.csolve.net> writes:

> Initialize the Python interpreter and then call one or a series of
> init procedures that calls Py_InitModule(), without having used
> "import spam" to create the module object. Can I get this to work?

I'm not sure why you want to do this. What is the purpose of
initialising a module that you are not going to use?

> I figure it should be possible to initialize these modules at
> run-time and thus get around the first two problems. Writing the
> glue code isn't a hardship, but again, the interpreter needs to be
> pointed to already instantiated interfaces, not stuff it has to
> instantiate itself.

If they are extension modules, they do have init* functions, right?
If not, why not?

Just put all these into an array _PyImport_Inittab (or extend the
existing array by PyImport_AppendInittab), and voilá, you have these
modules available to an application.

Regards,
Martin



More information about the Python-list mailing list