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
Post a Comment