관리 메뉴

Hee'World

IOError: [Errno 22] invalid mode('r') or filename: [해결방법] 본문

Programming/Python

IOError: [Errno 22] invalid mode('r') or filename: [해결방법]

Jonghee Jeon 2014. 10. 20. 17:05

파이썬에서 데이터파일을 불러올때 아래와 같은 에러가 발생 시


IOError: [Errno 22] invalid mode('r') or filename:


 아래의 3가지 방법을 이용하여 해결하면 된다. 


\t is a tab character. Use a raw string instead:

test_file=open(r'c:\Python27\test.txt','r')

or double the slashes:

test_file=open('c:\\Python27\\test.txt','r')

or use forward slashes instead:

test_file=open('c:/Python27/test.txt','r')


'Programming > Python' 카테고리의 다른 글

TensorFlow 설치  (0) 2016.06.07
OpenCV 패키지 설치 [Windows]  (0) 2016.06.07
머신러닝 인 액션 2.2.2 예제 에러  (0) 2016.04.24
module 불러오기  (0) 2015.08.08
[펌]데이터 분석을 위한 파이썬 라이브러리  (0) 2014.10.20
Comments