struct->bit access

Mike Spindler maspindler at yahoo.com
Mon Sep 13 10:58:23 EDT 2004


I am passing structs via UDP socket to my Python app from an external
C program.  The structure is made up almost entirely of bit fields.
 
struct example: 
 unsigned int var1 : 3;
 unsigned int var2 : 3;
 unsigned int var3 : 1;
 unsigned int pad1 : 1;
 unsigned int var4 : 8;
 unsigned int var5 : 16;

Everything I've read so far says this is too complicated and slow for
Python - write it in C.  Can someone point me to a good example of
extracting this and rebuilding using only Python?
Thank you!  -Mike



More information about the Python-list mailing list