CSPyInterpreter* it = CSPyInterpreter::NewInterpreterL(); CleanupStack::PushL(it); PyEval_RestoreThread(PYTHON_TLS->thread_state); PyRun_SimpleString("open(r'c:\\foo.txt', 'w').write('hello')\n"); PyEval_SaveThread(); CleanupStack::PopAndDestroy(it);
From Nokia Forum