본문 바로가기

Python

print 시 한글 깨짐 현상

반응형

print 하면 아래 처럼 나올때가 있다

 
 
그때는 아래 코드를 추가하면 정상적으로 출력된다
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8')
반응형