Embedded Python implementation

Evan tagith1394 at hotmail.com
Sat Sep 7 00:50:52 EDT 2002


I am currently trying to embed Python in an application I am writing, 
and all is going well, except for one inexplicable bug..

When I pass a variable (pointer to a string) to PyRun_String, it will 
always error on line 2, character 5.. regardless of what is actually on 
the line in that spot (for that matter, even if there is no line 2)..

The script works perfectly when I place it in a file, and use 
PyRun_File, and it also works perfectly when I place the string in 
quotations, and pass it to PyRun_String directly inside the C code..

The C code in question is as follows:
if ( PyRun_String( com_list, Py_file_input, pGlobals, pLocals ) == NULL )

I am confident the problem is not with pGlobals or pLocals, as those 
arguments are used with PyRun_File, as well as with the quoted string..

Thanks in advance,

More information about the Python-list mailing list