Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void runScript(std::string src)
- PyObject* glb = mainDict_;
- byteCode_ = Py_CompileString(src.c_str(), "", Py_file_input);
- //Check for Compile error, omitted for readability
- PyObject* loc = PyDict_New();
- PyObject* ret = PyEval_EvalCode(BYTE_CODE, glb, loc);
- //Check for runtime error, omitted for readability
- Py_XDECREF(ret);
- Py_XDECREF(loc);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement