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'
나는 지금 무엇을해야합니까 ??