Problem using PyRun_String()

Cedric Adjih adjih at crepuscule.com
Thu May 18 08:35:37 EDT 2000


Eric <eric at mixadlive.com> wrote:
> Hi,

> I'm having problems running PyRun_String() in C. Although my 
> code seems ok, the function returns NULL in every case and does 
> a system error. I've tried examples of the documentation and I still
> have the same results.

If you didn't do it, maybe you could print the traceback.

  PyObject* result=PyRun_String(....);
  if(result==NULL) { 
     PyErr_Print(); 
     ... bail out ...
  }
  
Then, if you show us the traceback, we might be more able
to help you [assuming the initialization steps were ok] :-)
  
-- Cedric



More information about the Python-list mailing list