Redirecting STDIO/STDERR in an python embedded application
Karl Bellve
Karl.Bellve at umassmed.edu
Tue Apr 3 09:29:26 EDT 2001
Donn Cave wrote:
>
> Quoth Karl Bellve <Karl.Bellve at umassmed.edu>:
> |
>
> - I bet you didn't specify METH_VARARGS for s_stdout, like
> {"s_stdout", s_stdout, METH_VARARGS},
I am using BOOST which should have done this for me :-) But I will
check...
When I checked the pointer being passed, it wasn't a simple parameter
but a complete structure.
>
> You don't need it, but if you omit it, then for single-parameter
> functions you don't get a tuple, just the parameter.
>
> - Missing a comma before "&string" (I suppose that's a typo.)
Yea, typo...I didn't do a cut and paste..development system is a
different computer that where I write email.
>
> - Return 0 after !PyArg_ParseTuple(), that's how you propagate an
> exception.
>
> - When you return Py_None, first write Py_INCREF(Py_None).
Again, Boost is supposed to be doing this...
--
Cheers,
Karl Bellve
More information about the Python-list
mailing list