Pass a tuple (or list) to a C wrapper function

Java and Swing codecraig at gmail.com
Thu Oct 13 08:38:46 EDT 2005


Fredrik...I forgot about that...wish Google Groups had a way to quickly
find the topics a user posts.

anyhow, for receiving an object from python..is it

ok = PyArg_ParseTuple(args, "sO", &x, &y);

...is it "sO" or "s0" ....is it O (as in the letter) or 0 (as in the
number)?  I would think "O" the letter..but it looks like a zero.

thanks

Fredrik Lundh wrote:
> Jeremy Moles wrote:
>
> > Probably what you want to do though is just keep the tuple as is and
> > iterate over it using the PySequence_* protocol:
> >
> > http://docs.python.org/api/sequence.html
>
> I did post a complete and tested example a few days ago, which contained
> code that showed how to do this.  a complete waste of time, of course.
> 
> </F>




More information about the Python-list mailing list