
Python
文章平均质量分 67
丁路人
这个作者很懒,什么都没留下…
展开
-
Beautiful Soup安装
作为Python的新手,安装这额Beautiful Soup库,也走了很多弯路。 第一步去http://www.crummy.com/software/BeautifulSoup/#Download下载: (我下载这个4.3.2时,没有权限,只好下载这个4.3.1了)。 第二步就是随便找个地方,解压缩一下文件夹: 然后运行一下setup.py,把bs4文件夹拷到lib文件夹下,原创 2013-10-26 10:39:50 · 1107 阅读 · 0 评论 -
python 字典(dict)按值排序
参考: 【1】python 字典(dict)按键和值排序 http://www.cnpythoner.com/post/266.html 【2】python dictionary error AttributeError: 'list' object has no attribute 'item' http://stackoverflow.com/questions/17393202/pyth原创 2013-10-28 17:02:35 · 1608 阅读 · 0 评论 -
怎样使python的字符串在sql语句中为自然字符串。
在Python中,可以用单引号、双引号、三引号表示字符串,但是这些还不够,例如执行下面的代码: co = cur.execute("select id from %s where %s = '%s'" % (table, field, value)) 假如这个value中,包含单引号,就会出现错误,进一步改为: co = cur.execute('''select id from原创 2013-10-23 17:25:22 · 3646 阅读 · 0 评论 -
简单的解析Google Scholar数据
现在只是简单的查询一篇文章,但是可以给python小白用户(比如像我这样的)提供启发,直接上代码: import urllib2 import re, random from bs4 import BeautifulSoup def GoogleScholarTitle(queryTitle): user_agents = ['Mozilla/5.0 (Windows NT 6.原创 2013-11-11 22:18:19 · 4626 阅读 · 0 评论 -
numpy的安装
参考: 【1】Installing numpy - the system cannot find the file specified (msvcr90.dll) http://stackoverflow.com/questions/25072357/installing-numpy-the-system-cannot-find-the-file-specified-msvcr90-dll 【原创 2015-10-08 22:49:49 · 1958 阅读 · 0 评论