필요한 곳에서 임베디드 파이썬 인터프리터의 작업을 일시 중지/다시 시작할 수 있습니까? 예를 들면 :임베디드 파이썬 인터프리터 일시 중지/재개
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!
}
...
}
파이썬 스크립트 의사 코드 부분 :
#... 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
이 파이썬/C API를 할 수 있습니까?
감사