[C++-sig] Python/C PyRun_String
venkat83 at gmail.com
Sat Mar 29 02:36:10 CET 2008
Am using Pythong/C API for embedding. I have written a small-simple wrapper
that does the low level functions and exposes the functionalities in a c++
style(i.,e the application layer doensnt use 'PyObject'). I am reading the
contents of a file(Python script) and am running the same using
PyRun_String; the script setups some variables in the Main Dict which i
access it using the PyArg_Parse...etc etc(the standard way). This keeps
running in a loop - i.,e it needs to be processed for every transaction -
hence the Python wrapper is a singleton which preserves the main dict.
Am stumbling on a problem wherein when i try to access a variable in Python
from C as a string - this variable in python was constructed by
concatenating a float with a string(using 'str'), and hence the resulting
python variable is also a string. If i comment out the variable , then the
program runs fine; else it(C program) throws out a segmentation fault. A
clueless as to how to debug this and suitable hints would be immense help.
(If required , i can share the code for this - i just didnt want to send it
Secondly, can anyone point me to the Boost::python way of embedding -
basically, i would like to know how to build/compile the program without
Blog @ http://blizzardzblogs.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cplusplus-sig