PyImport_ImportModule

Fredrik Lundh fredrik at pythonware.com
Fri Mar 16 17:35:05 CET 2001


Charlie Barrows wrote:
> I'm just starting to tinker with embedding Python in a C app and I'm trying
> to get a handle on where modules end up when they're imported.
>
> If I run this code:
>
> PyObject *module = PyImport_ImportModule("TestScript");
>
> ... which namespace is TestScript imported into?

it's own namespace, of course.

ImportModule is the same thing as "import module", not
"from module import *".

Cheers /F





More information about the Python-list mailing list