I am trying to use the python bitstring module in a script and getting an import error. This error does not occur when working in interactive mode.
Here is the code:
import bitstring b = bitstring.BitArray(bin='001001111')
At startup:
python test.py
I get this:
AttributeError: 'module' object has no attribute 'BitArray'
However, when I do this:
$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import bitstring >>> b = bitstring.BitArray(bin='001001111') >>> print b 0b001001111
Everything is fine! This is the same interpreter that is controlled by the same user. Any pointers?
source share