C type buffer copy

joe@gmail.com doodle4 at gmail.com
Tue Mar 22 12:49:11 EST 2005


Hello,

How does Python deal with C type memory buffers. Does Python return
everything as an object irrespective of the data type?

Here's what i am trying to achieve?

testCode(unsigned char buf, unsigned long len)
{
    unsigned long data=0x0;
    while (len--)
    {
        *buf++ = (unsigned char)data++
    }
    ....
}

What's the best way to deal with this in python?

-Joe




More information about the Python-list mailing list