I have an existing C++ application and have wrapped a few of the classes with python using SWIG. What do I have to do next to be able to open a python console while the C++ app is running and access its runtime objects (of the classes I have already wrapped)?
Asked
Active
Viewed 73 times
4
-
In general, you *don't* get access to the memory of another process. – chepner Aug 01 '14 at 16:02
-
4The most obvious solution would be to embed a python interpreter in your C++ app. There's a part named "extending and embedding" in python's doc IIRC – bruno desthuilliers Aug 01 '14 at 16:10
-
@chepner duh, that's why I'm asking this. – Matt Aug 01 '14 at 17:03
-
@brunodesthuilliers, Thanks, but unfortunately the "Embedding Python in C++" section is two sentences long and explains very little. – Matt Aug 01 '14 at 17:04
-
Does http://stackoverflow.com/questions/9040669/how-can-i-implement-a-c-class-in-python-to-be-called-by-c answer this for you? There's a complete example for both SWIG and Boost.Python there. – Flexo Aug 03 '14 at 13:47
-
@Flexo, yes. It seems all I needed was the word "embed" and now I can find tons of information, but that particular answer was the most helpful. – Matt Aug 04 '14 at 14:06