I would like to embed the python interpreter, but not in the way most other people do. I don't need to multi-thread unless it's necessary to do as follows... What I need is control over when execution happens. More specifically, I would like to use a python script to call some C++ functions that modify variables in my program, and I would like to PAUSE the python interpreter's execution whenever it finishes calling specific functions, and return execution to my C++ program. I would like to be able to resume execution in the python interpreter later, from the same place in the Python script.

Can anyone point me to some good resources? (The Python documentation doesn't mention anything specifically designed for execution control, but if there is something I could use, that would be great).

Maybe the Python API has some functions for setting the python interpreter globals and locals, so I can reset it to read from a specific line when execution returns?

Maybe there's something I can put in the Python script that returns execution to the C++ program?

SOLVED...How do you mark as solved?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.