<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.1">
</HEAD>
<BODY>
Hi,<BR>
<BR>
I am trying to represent a number as a list of bits: for example the bit representation of the integer 8. I did find a number of articles pertaining to a module called bitarray but I was unable to download/install that package. I am using Linux on Ubuntu 9.10; Python 2.6.2. <BR>
<BR>
I am almost certain there is a relatively easy way to convert an integer that can be represented by 32 bits into an array of bits that I can iterate over looking for switched on bits or switched off bits. <BR>
<BR>
Any information such as recipes or past articles in this list providing methods to create and manipulate&nbsp; bit arrays would be most appreciated.<BR>
<BR>
Robert<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>