必要に応じて、組み込みの python インタープリターの作業を一時停止/再開する可能性はありますか? 例えば:
C++ 擬似コード部分:
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
これは Python/C API で可能ですか?
ありがとう