# 1. 파일에 쓰고 읽기 with open("notes.txt", "w", encoding="utf-8") as f: f.write("에이전트 작동이 시작되었습니다. \n") f.write("tool: search \n") with open("notes.txt", "r", encoding="utf-8") as f: contents = f.read() print(contents) print("characters: ", len(contents)) #-------- 2. 로그 파일에 추가하기 with open("runlog.txt", "a", encoding="utf-8") as f: f.write("1단계 | searc..