python 安装easy_install工具(转)
安装easy_install工具
使用ez_setup.py脚本方便安装:
wget?-q?http://peak.telecommunity.com/dist/ez_setup.py
python?ez_setup.py
安装完后,最好确保easy_install所在目录已经被加到PATH环境变量里:
Windows:?C:\Python25\Scripts
Linux:?/usr/local/bin
easy_install?Mechanize
easy_install?BeatifulSoup
from?BeautifulSoup?import?BeautifulSoup?
page?=?"<a><s>中文</s></a>"
soup?=?BeautifulSoup(page,?fromEncoding="utf-8")
print?soup
f?=?open("ss.txt",?"w+")
f.write(str(soup))
f.close()