SEARCH
TOOLBOX
LANGUAGES
Python

Python

From Chaehyun

Revision as of 08:29, 31 January 2013 by Xlos (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

unicode로 출력된 string 변환

  • print word.decode('unicode_escape')

beautifulsoup 사용할 때

  • encoding 을 알고 있을 때 깔끔하게 정리하기
  • unicode_html = myfile.read().decode('utf-8', 'ignore')
  • soup = BeautifulSoup (unicode_html)

pyquery 설치

  • easy_install pyquery
  • pip install pyquery
  • 오류가 발생하면
    • apt-get install libxml2-dev libxslt-dev
    • apt-get install python-lxml
  • 이걸 미리 해줘야함
    • apt-get install libxml2-dev
    • apt-get install libxslt-dev
Retrieved from "http://chaehyun.kr/w/Python"