python - struct.error: unpack requires a string argument of length 2 -


i have following code works 64bit computer not work mine , gives fallowing error.i use python 3.3 , requiered libraries. not solve problem please help.

import matplotlib.pyplot plt import binascii import numpy import struct  array = [] out = open('output.txt','wb')  a=int(input("enter first value:")) b=int(input("enter second value:"))  open("thefile.bin", "rb") f:      i=0      in range(0, a):         byte = f.read(1)      i=0     in range(a,b):         byte = f.read(1)         value = struct.unpack('b', byte)[0]         array.append(value)   plt.plot(array) plt.ylabel('value') plt.show() 


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -