-2
晚報所有,EOF錯誤在Python
我已經做在Python程序,它或多或少存在,但最後的結果是引起EOF錯誤,我很困惑,爲什麼或如何解決它!
myFile =open("positionfile.dat", "rb") #opens and reads the file to allow data to be added
positionlist = pickle.load(myFile) #takes the data from the file and saves it to positionlist
individualwordslist = pickle.load(myFile) #takes the data from the file and saves it to individualwordslist
myFile.close() #closes the file
帶着一堆代碼在它之前。
的錯誤是:
Traceback (most recent call last):
File "P:/A453 scenario 1 + task 3.py", line 63, in <module>
individualwordslist = pickle.load(myFile) #takes the data from the file and saves it to individualwordslist
EOFError
任何幫助,將不勝感激!
你確定這是你的腳本嗎?我看到知道錯誤。在你當前的程序中。 –
我們需要了解數據如何寫入文件。 –
你在抱怨解析文件時出現錯誤。您既不顯示該文件中的內容,也不顯示它是如何創建的。有人會怎麼回答?如果你的課程需要幫助,請與你的老師談談,以確保你沒有作弊。 – jonrsharpe