사용자 도구

사이트 도구


python:file

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
마지막 판 양쪽 다음 판
python:file [2012/08/01 10:40]
kwon37xi [Unicode File]
python:file [2012/08/01 10:44]
kwon37xi
줄 1: 줄 1:
 ====== Python File 다루기 ====== ====== Python File 다루기 ======
 +  * [[http://docs.python.org/tutorial/inputoutput.html|Python Input Output]]
   * [[http://docs.python.org/release/2.5.2/lib/bltin-file-objects.html|Builtin File Object]]   * [[http://docs.python.org/release/2.5.2/lib/bltin-file-objects.html|Builtin File Object]]
  
줄 33: 줄 33:
  
 ==== 쓰기 ==== ==== 쓰기 ====
-쓰기시에는 unicode 객체를 저장해야 한다.<code python>+쓰기시에는 unicode 객체를 저장해야 한다. 
 +<code python>
 f = codecs.open('test', encoding='utf-8', mode='w+') f = codecs.open('test', encoding='utf-8', mode='w+')
 f.write(u'\u4500 blah blah blah\n') f.write(u'\u4500 blah blah blah\n')
 </code> </code>
python/file.txt · 마지막으로 수정됨: 2012/08/01 10:50 저자 kwon37xi