PyImport_ImportModule, PyModule_GetDict

Randy Heiland heiland at ncsa.uiuc.edu
Thu Jul 8 11:36:28 EDT 1999


If I understand this correctly, the equivalent of doing this:

>>> import mymodule
>>> dir(mymodule)

is sort of this, in the C API:

PyObject *mod = PyImport_ImportModule("mymodule");
 PyObject *myDict = PyModule_GetDict(mod);

Q:  what is the C API equivalent of this:

>>> from mymodule import *
>>> dir()


--Randy






More information about the Python-list mailing list