C pointers/Python

joe@gmail.com doodle4 at gmail.com
Mon Mar 21 18:52:44 EST 2005


Hello,

I am trying to convert some C code into python.
Here's the C code...

typedef enum {
CODE1 = 0x1,
CODE2 = 0x2
} CODE
testit(unsigned char *buffer,
       unsigned long length,
       CODE code)
{
    unsigned long data
    switch (code)
    {
      case CODE1:
      while(len--)
      {
          *buffer++ = (unsigned long)data++
      }
      break
      case CODE2 :
     .....

}
How does python take care of pointers? Any help with python pointer
code appreciated.     
-Joe




More information about the Python-list mailing list