C Module question
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Mon Nov 10 07:16:58 EST 2008
On Mon, 10 Nov 2008 03:11:06 -0800, boblatest 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
> 2. How can I preserve information needed in the C part between calls to
> my module functions? The way I've thought of is: - put this information
> in a dynamically allocated struct - pass it out of and into the C module
> as CObject into/from an intermediate Python wrapper module where it gets
> stored in a Python object
Why passing it in and out? Simply use the C module level to store the
information.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list