Beginner's question : Embedding Python - problem with PyRun_SimpleString

Adrian Eyre a.eyre at optichrome.com
Fri Oct 8 12:21:29 EDT 1999


> #include <python.h>
> Py_Initialize();
> status = PyRun_SimpleString( myCmdLine);
> I tried this with : myCmdLine = "a = 5" ;
> and got a status equal to -1 !!!

Looking at the source code, this means that an exception
occurred and got printed to stderr. If you're running
under Win32, this information will be lost, unless you
redirect stderr to something else.

--------------------------------------------
Adrian Eyre <mailto:a.eyre at optichrome.com>
Optichrome Computer Solutions Ltd
Maybury Road, Woking, Surrey, GU21 5HX, UK
Tel: +44 1483 740 233  Fax: +44 1483 760 644
http://www.optichrome.com 
--------------------------------------------





More information about the Python-list mailing list