Beginner's question : Embedding Python - problem with PyRun_SimpleString

Jean Pierre Cazeaux jp.cazeaux at systus.com
Fri Oct 8 11:23:16 EDT 1999


I have searched into the documentation available on Python's Website without
finding any answer to my question.
So may be one of you can help me :
Trying to embed Python into a C++ application, I followed the
recommendations found in the tutorial:
Basically :
#include <python.h>
Py_Initialize();
status = PyRun_SimpleString( myCmdLine);

I tried this with : myCmdLine = "a = 5" ;
and got a status equal to -1 !!!

What's wrong with what I did ?
How can I get the result of the command ?
How can I get information about the raised exception ?


Thanks for your help.

Jean-Pierre.







More information about the Python-list mailing list