파일 끝 부분에 문자열을 추가하려했지만 작동하지 않습니다. 이 오류를 얻을 :파이썬에서 파일 끝에 뭔가 추가 하시겠습니까?
IOError: (9, 'Bad file descriptor')
나는 #hashcomment에 부합 그것은 아래의 코드에서의 123에 그것을 얻을하지만 표시 :
pluginlokacija2 = os.path.realpath("%s/plugins"%os.getcwd())
fo = open("%s/TwistedJobs/config.yml"%pluginlokacija2, "wb")
old = fo.read() #this is line no. 123
fo.seek(0)
fo.write("%s\n- %s\n " % (old, event.getPlayer().getName()))
fo.close
사전에 감사, 아마르을!
P. 더 자세한 정보가 필요하면 의견으로 문의하십시오!
당신에게 쓰기를 위해 파일을 연 다음 그 파일을 읽으려고했습니다. – martineau