![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
cselkenpeng
这个作者很懒,什么都没留下…
展开
-
python 编码
网页的编码方式是简体中文gb2312 (查看网页源码,可以看到),而python内部的编码方式为unicode,之前的代码是这样的: contentAll = urllib.urlopen(urlLink).read() soup = BeautifulSoup.BeautifulSoup(contentAll) #生成BeautifulSoup对象 经过url定位得到html的d转载 2012-07-14 17:57:39 · 1697 阅读 · 0 评论 -
记录
1. 'dz' if string.atoi(sid[-1], 16)%2 else 'exp' 2 list 创建[], list() 切片, in 新增, a_list = a_list + [2.0, 3] ,a_list.append(True),a_list.extend(['four', 'Ω']),a_list.insert(0, 'Ω'), extend原创 2012-09-05 10:36:51 · 319 阅读 · 0 评论