Pause/Resume embedded python interpreter
Hello! Tell me please, Is there any possibility to pause/resume the work of embedded python interpreter in place, where I need? For example: C++ pseudo-code part: main() { script ="python_script.py"; ... RunScript(script);//-- python script runs till the command 'stop' while(true){ //... read values from some variables in python-script //... do some work ... //... write new value to some other variables in python-script ResumeScript(script);//-- python script resumes it's work where// it was stopped. Not from begin! } ... } Python script pseudo-code part: #... do some init-work whiletrue: #... do some work stop # - here script stops and C++-function RunScript() # returns control to C++-part #... After calling C++-function ResumeScript # the work continues from this line Is this possible to do with Python/C API? Thanks
participants (3)
-
M.-A. Lemburg
-
Ulf Worsoe
-
Тушев Сергей