Guest User

Untitled

a guest
Mar 9th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. import numpy
  2.  
  3. data = numpy.fromfile('binaryfile', dtype=numpy.uint16)
  4.  
  5. for bit in range(16):
  6.     print('Bit', bit)
  7.     text = numpy.empty((len(data) * 2, ), dtype=numpy.uint8)
  8.     text[1::2] = ord('\n')
  9.     text[0::2] = ord('0') + (data & (1 << bit) != 0)
  10.     print(text)
Advertisement
Add Comment
Please, Sign In to add comment