PyImport_ImportModuleEx() ?

Charlie Barrows charlie at gabrielinteractive.com
Thu Mar 15 14:37:06 EST 2001


I'm just starting to tinker with embedding Python in a C app and I'm having
trouble getting PyImport_ImportModuleEx() to import [*] of a module into
__main__.

More specifically: I can get it to import the module fine as a separate
namespace, but, just for the sake of thinking I know what I'm doing, I
wanted to import all the module's functions into __main__'s namespace.

I guess you could also say I'm looking for the PyImport_ version of this
line:

PyRun_SimpleString("from TestScript import *\n");

I was thinking some combination of PyImport_ImportModuleEx would do the
trick but haven't been able to figure it out.

Am I missing one or more points here?

Thanks.

Charlie Barrows
Gabriel Interactive





More information about the Python-list mailing list