인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

iya7777's profile image
iya7777

asked

Getting Started with Programming: Introduction to Python (Inflearn Original)

텍스트 file write 실습 에러 상황 문의 드립니다.

Written on

·

120

0

9-1 파일쓰기 실습시 

with open('./resource/contents1.txt', 'w') as f:

    f.write('I love python\n')

명령어 실행시 contents1.txt 파일은 생성이 되는데, 내용을 확인하면

SCRED Default Temporary File !!

[REDIRECTED_PATH] = \\?\V:\mirror\C\python_basic\resource\contents1.txt

라는 문구만 뜹니다.

쓰기 경로 설정 같은게 잘못된 거 같은데,,,, 확인 부탁드립니다~

python

Answer 1

0

niceman님의 프로필 이미지
niceman
Instructor

안녕하세요. iya님

\\?\V:\mirror\C\python_basic\resource\contents1.txt

경로가 잘못되었네요! c:\python_basic\resource\contents1.txt 이런식으로 절대경로로 넣어보시고

실행이 된다면 그 때 상대경로 또는 절대 경로로 사용하시면 됩니다.

나중을 위해서 상대경로도 꼭 알아두세요!

iya7777's profile image
iya7777

asked

Ask a question