python2 utf8인코딩

python 2017. 7. 29. 16:06

1. utf8 형식으로 코딩됨 알림

코드시작부분에 추가


#-*- coding: utf-8 -*-



2. 유니코드 스트링

string 앞에 u를 입력


u'가나다라'



3. utf8 파일


import codecs

codecs.open('filename','읽기쓰기',encoding='utf8')



'python' 카테고리의 다른 글

jupyter notebook 비밀번호 변경  (0) 2021.09.28
python 오브젝트 함수,변수 리스트  (0) 2018.04.02
디렉토리 순회  (0) 2018.03.09
dictionary sort  (0) 2018.02.19
python string to dict or list etc...  (0) 2016.12.29
Posted by rjh
,