[EMAIL PROTECTED] wrote: > How would I go about writing a bitfield that can be read by my C app? I > want to pack a few bools into one int. > > I know an extended module exists (npstruct) which helps you do this but > I want to do it manually or using one of the standard modules. > struct.pack is in the Standard Library and allows you to do what you want. You may find that you must also do some "bit twiddling" using << shift functions and | bit or function if you want to pack tighter than on 4 bit boundaries.
Larry Bates -- http://mail.python.org/mailman/listinfo/python-list