elif(ch==2):
fh=open("emp1.txt","rb+")
fo=open("temp.txt","wb+")
ecode=input("Enter the Ecode :")
rec=(" ")
try:
while True:
emp1= pickle.load(fh)
if (emp1.ecode!=ecode):
pickle.dump(emp1,fh)
except(EOFError):
fh.close()
fo.close()
os.remove("empl.txt")
os.rename("temp.txt","emp1.txt")
print("")
次のコードを実行すると、私は、このエラーを与える:pickle.loadで例外EOFError見つからないエラーファイル
Traceback (most recent call last): File "C:\Users\hello\Desktop\bhavi\python programming\Employ.py", line 78, in emp1= pickle.load(fh) EOFError
上記の例外の取り扱い時には、別の例外が発生しました:
Traceback (most recent call last): File "C:\Users\hello\Desktop\bhavi\python programming\Employ.py", line 85, in os.remove("empl.txt") FileNotFoundError: [WinError 2] The system cannot find the file specified: 'empl.txt'
私は今どうすればいい??