Suggestion for easier c/c++ interfacing

Albert Hofkamp hat at se-46.wpa.wtb.tue.nl
Fri Apr 23 10:15:00 EDT 1999


Hello all,

I have been experimenting with c++ and Python, and am working on
attaching generated c++ module-code to python.

In the EXT document, it is explained how to parse arguments from python
in c code using PyTuple_ParseArgs(). This is really easy to use.

However, the same kind of parsing must occur after a call from c to a
python function. The return value from that function is again a Python
object, and needs to be decoded before it can be used in c.
Unfortunately, the returned value is not a tuple, so PyTuple_ParseArgs()
cannot be used. A shortcut would be to wrap the result in a tuple with 1
argument, and then call the decoding function, but I consider that a hack.

Wouldn't it be possible to create a PyTuple_ParseArgs()-like function to
parse return results from python functions ?


Albert
---
Look ma, windows without Windows !!




More information about the Python-list mailing list