1

私はこの次のコードを持っています.64ビットの別のコンピューターでは動作しますが、私のものでは動作せず、次のエラーが発生します.Python 3.3と必要なライブラリを使用しています. 問題を解決できませんでした。助けてください。

import matplotlib.pyplot as plt
import binascii
import numpy
import struct

array = []
out = open('output.txt','wb')

a=int(input("Enter the first value:"))
b=int(input("Enter the second value:"))

with open("thefile.bin", "rb") as f:

    i=0 
    for i in range(0, a):
        byte = f.read(1)

    i=0
    for i 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()
4

0 に答える 0