Thanks everyone for all the suggestions! New to python, so reading up on the 
struct module & Construct library now, hope to get my problem fixed soon.
  ----- Original Message ----- 

  Bitfields are most commonly used for extreme space optimization - i.e. 
shoving several variables and flags with carefully limited ranges into a single 
work. In Python you rarely work this way (where such an optimization is 
warranted, Python isn't the best tool for the job). However, as in your use 
case, it is sometimes needed in Python in order to communicate with other 
devices over the network or some other link.

  In my work with Python and embedded devices I've found the construct library 
(http://construct.wikispaces.com/) very useful. It allows to you very easily 
define complex formats for frames/messages on the bit and byte level. The idea 
is to use construct to encode and decode messages being sent to an embedded 
device. It works great.

  If you have further questions about this approach, feel free to ask.

  Eli







------------------------------------------------------------------------------


  --
  http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to