Есть ли возможность приостановить/возобновить работу встроенного интерпретатора python на том месте, где мне нужно? Например:
Часть псевдокода С++:
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:
#... do some init-work
while true:
#... 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
Возможно ли это сделать с API Python/C?
Спасибо