C Module question
boblatest at googlemail.com
boblatest at googlemail.com
Mon Nov 10 08:36:58 EST 2008
On Nov 10, 1:16 pm, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> On Mon, 10 Nov 2008 03:11:06 -0800, boblat... at googlemail.com wrote:
> > 1. How can I pass a file-like object into the C part? The PyArg_*
> > functions can convert objects to all sort of types, but not FILE*.
>
> http://docs.python.org/c-api/file.html#PyFile_AsFile
Yes, got it. At first I thought I had to use the "Parse" functions for
my args, but in fact I can of course just access the args as a tuple
(and then do the type checking myself).
> Why passing it in and out? Simply use the C module level to store the
> information.
But if I create several instances of a class (in the wrapper module)
my C methods won't know which object they were called on.
robert
More information about the Python-list
mailing list