Running a python script in turn using the Python Python API

My goal is ultimately to execute a python script that manipulates the values ​​in my C ++ program, one line at a time, returning the execution of my C ++ program between the statements in the python script. Right now, I'm trying to feed the python interpreter of my script one line at a time. But he wants a context, and I have no idea how to build it. Can someone point me to some good tutorials (the documentation is not very good for this).

I chose the answer that most accurately answered my question, but I believe that this may not be enough for some applications. The answer that works for these applications may include lower level calls in the Python API. Please answer the question if you have an answer that provides more control over execution.

I asked the next question after this, because after that I came across various problems that are very closely related. Link: Python C API - Termination (and continued later)

+5
source share
3 answers

, script . sys.settrace(), , . C API, PyEval_SetTrace, .

+3

100%, , 8 - . ++ python. win32, Qt, gcc. , gdb, gcc, python. , . ++!

+1

, , .. , , python script ++. , .
c , , c- python python .

, . , , , : Python C/++?

0

All Articles