-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