I have some trouble reading binary file
TypeError: unsupported operand type(s) for &: 'int' and 'str'
Also
and
for both says
ValueError: invalid literal for int() with base 10: 'i'
i dont know what im doing wrong
with open('myfile', 'rb') as fl: b = fl.read( 1 ) for x in range( 0,4): tuppleCounter[ ( ( 3 << ( x * 2 ) ) & b ) >> ( x*2 ) ]+=1The interpreter says
TypeError: unsupported operand type(s) for &: 'int' and 'str'
Also
b = int( fl.read( 1 ), 10 )
and
b = int( fl.read( 1 ) )
for both says
ValueError: invalid literal for int() with base 10: 'i'
i dont know what im doing wrong