Maxime pointed me this great example ExecutePythonScript() of running a python script from c++.
I succeeded to compile this example in R20.
Now, because we still have user running R19, I want to do the same in R19.
Is this possible?
Is there a similar example for R19.
Especially, setting scope variables is really good and what I need.
I can use the example from https://plugincafe.maxon.net/topic/8164/10638_can-c-execute-python-solved/5, but that one does not support scope variables (I guess).
The interfaces used in the ExecutePythonScript() are part of the python.framework, which was introduced with R20. So I guess that there is nothing equivalent in prior versions.
Yes, I think so too.
Hi Pim sorry for the late reply, this is possible by using the lib_py.h (typically this is somehow what we used before R20 to expose feature in python, but it's way elder, not everything is possible to do, you have less control than with the new python.framework, and the lib_py.h is not maintained (so don't expect any enhancement in it) Only the python.framework will be enhanced.
// Init Python
// Acquiere the GIL
// If doc->GetFirstObject() is nullptr, op variable will not be declared in the python scope, and you cant add a None.
maxon::String pythonCode = "\
if __name__ == '__main__' :\n\