Packing a ctypes struct containing bitfields.

2009-06-18 Thread Karthik
Hello Everybody, I'm trying to create a packed structure in ctypes (with one 64-bit element that is bitfielded to 48 bits), unsuccessfully: === from ctypes import * class foo (Structure): _pack_ = 1 _fields_ = [ (bar,c_ulonglong, 48), ]

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Nick Craig-Wood
Karthik karthik301...@gmail.com wrote: Hello Everybody, I'm trying to create a packed structure in ctypes (with one 64-bit element that is bitfielded to 48 bits), unsuccessfully: === from ctypes import * class foo (Structure): _pack_ = 1

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Karthik
On Jun 18, 6:29 pm, Nick Craig-Wood n...@craig-wood.com wrote: Karthik karthik301...@gmail.com wrote:  Hello Everybody,  I'm trying to create a packed structure in ctypes (with one 64-bit  element that is bitfielded to 48 bits),  unsuccessfully: ===  

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Lawrence D'Oliveiro
In message ec2dda8a-8139-46f8-808b- cc9eaa632...@d19g2000prh.googlegroups.com, Karthik wrote: from ctypes import * Don't do that. -- http://mail.python.org/mailman/listinfo/python-list