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
GePython pythonScope;
pythonScope.Init();
// Acquiere the GIL
GePythonGIL gil_state;
pythonScope.SetNode("doc", doc);
// If doc->GetFirstObject() is nullptr, op variable will not be declared in the python scope, and you cant add a None.
pythonScope.SetNode("op", doc->GetFirstObject());
maxon::String pythonCode = "\
import c4d\n\
\n\
def main():\n\
print(doc, op)\n\
\n\
if __name__ == '__main__' :\n\
main()\n\
"_s;
StopAllThreads();
pythonScope.Run(pythonCode);
Cheers,
Maxime.