How can I get a PyObject reference to an object already created?

Yuriy Gorvitovskiy yuriy at
Fri Mar 17 04:21:41 CET 2000

You can try this function:
    PyObject* PyRun_String (char *str, int start, PyObject *globals,
PyObject *locals)
But I can't find the description of it in documentation.

I'm doing this way:

m_PyPublishModule = PyImport_ImportModule("CustomScript");
PyObject* pPyNewObject = PyObject_CallMethod(m_PyPublishModule,
if (!pPyNewObject)
    // Do Your Work


drugar at wrote in message <8arruu$dpm$1 at>...
>In particular this is  Win32 project that embeds the python
>interpretor.  Can I get a PyObject reference to an object that is
>created by a script?
>For example:
>PyRun_SimpleString("import CustomScript\n");
>Is there anyway to get a reference to t? or any other object that is
>created by importing CustomScript?  Assuming I know it's "name".
>Sent via
>Before you buy.

More information about the Python-list mailing list