背景:广告商往往想知道关于一个人的一些特定人口统计信息,以便能更好地定向推销广告。我们将分别从美国的两个城市中选取一些人,通过分析这些人发布的信息,来比较这两个城市的人们在广告用词上是否不同。如果结论确实不同,那么他们各自常用的词是那些,从人们的用词当中,我们能否对不同城市的人所关心的内容有所了解。...
分类:
编程语言 时间:
2015-10-08 00:31:45
阅读次数:
493
参考资料: 1. 《Python基础教程》 2. http://www.runoob.com/python/python-lists.html 3. http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fa...
分类:
编程语言 时间:
2015-10-08 00:30:56
阅读次数:
218
Python2.7里内置了很多非常有用的库,它在我电脑上的位置在/usr/lib/python2.7中。写个基本的爬虫要用到的库有urllib、urllib2、cookielib、sgmllib和re,下面先分别简单介绍下一些文件的信息和相关函数——具体的真的是建议阅读源码,网上找的资料反而不及它直...
分类:
编程语言 时间:
2015-10-08 00:27:20
阅读次数:
306
参考资料: 1. 《Python基础教程》 2. http://www.runoob.com/python/python-strings.html 3. http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103...
分类:
编程语言 时间:
2015-10-08 00:24:45
阅读次数:
272
参考资料: 1. 《Python基础教程》 2. http://www.runoob.com/python/python-chinese-encoding.html 3. http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb...
分类:
编程语言 时间:
2015-10-08 00:20:54
阅读次数:
171
Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then...
分类:
其他好文 时间:
2015-10-08 00:20:08
阅读次数:
202
#!/bin/envpython
#coding:utf-8
filename=‘/py/Day01/Contact/userinfo‘
init_username=‘frame‘
init_password=‘frame‘
success=0
whileTrue:
username=raw_input("Username:").strip()
password=raw_input("Password:").strip()
ifusername==init_username:
whilepassword!=i..
分类:
编程语言 时间:
2015-10-07 23:09:12
阅读次数:
496
今天在维护服务器的时候,发现有5个nova-novncproxy的僵尸进程。26327 ? S 0:05 \_ /usr/bin/python /usr/bin/nova-novncproxy --config-file=/etc/nova/nova.conf4765 ? Z 0...
分类:
系统相关 时间:
2015-10-07 22:57:10
阅读次数:
414
参考资料: 1. 《Python基础教程》 2. http://www.runoob.com/python/python-chinese-encoding.html 3. http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb...
分类:
编程语言 时间:
2015-10-07 22:56:12
阅读次数:
172
python入门编码:Python 文件中如果未指定编码,有中文代码时候,在执行过程会出现报错:File "test.py", line 2SyntaxError: Non-ASCII character '\xe4' in file test.py on line 2, but no encodi...
分类:
编程语言 时间:
2015-10-07 22:45:36
阅读次数:
189