I am trying to redirect Pythons STDIO/STDERR within my application. Here is the python code: PyRun_SimpleString("class my_stdout:\n" " def write(self,string):\" " image.stdout(string)\n" "import sys\n" "sys.stdout = my_stdout()\n"); And here is the C++ code: static struct _object *s_stdout(PyObject *self, PyObject *args) { char *string = NULL; if (!PyArg_ParseTuple(args, "s" &string)) return Py_None; /* some code return Py_None } The function s_stdout is being called but PyArg_ParseTuple is failing. I believe it doesn't think there is a string in the "args" Object. When I look at the "args" object, it claims it is a "string" but I don't actually see any text associated with it, other than "string." Any ideas? -- Cheers, Karl Bellve
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4