SEARCH
TOOLBOX
LANGUAGES
Python

Python

From Chaehyun

Revision as of 05:33, 26 December 2012 by Xlos (Talk | contribs)
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
Retrieved from "http://chaehyun.kr/w/Python"