How to create an array of bits in Python?

from bitarray import bitarray

a = bitarray(2**20)

You can check out more info about this module at http://pypi.python.org/pypi/bitarray/

Leave a Comment