- 博客(14)
- 资源 (10)
- 收藏
- 关注
原创 Python 半自动登录知乎-验证码需要识别
import timefrom bs4 import BeautifulSoupimport requests__file__ = 'zhihudata.py'__author__ = 'Jerry Liu'__date__ = '2016-04-21'headers_base = { 'Accept': 'text/html,application/xhtml+xml,applic
2016-04-21 16:29:53 1757
原创 Show me the code之Python练习册Q23-留言板
源码:https://git.oschina.net/liuyu2783/Python-Django.git问题总结:
2016-04-18 16:59:11 378
原创 phyton3.5 django典型错误
1、使用命令安装pymsql>pip install -U --force-reinstall PyMySQL2、在工程的__init__.py文件中增加一下2行代码import pymysqlpymysql.install_as_MySQLdb()
2016-04-18 14:44:32 361
原创 Show me the code之Python练习册 Q17~19 xml操作
__file__ = 'A17.py'__author__ = 'Jerry Liu'__date__ = '2016-04-15'""" 问题: 第 0014 题中的 student.xls 文件中的内容写到 student.xml 文件中,如下所示: <?xml version="1.0" encoding="UTF-8"?> <root>
2016-04-18 09:26:49 679
原创 Show me the code之Python练习册 Q14~16 excel操作
""" 问题:纯文本文件 student.txt为学生信息, 里面的内容(包括花括号)如下所示: { "1":["张三",150,120,100], "2":["李四",90,99,95], "3":["王五",60,66,68] } 请将上述内容写到 student.xl
2016-04-14 16:02:12 440
原创 Show me the code之Python练习册 Q13 获取网络图片
""" 问题:用 Python 写一个爬图片的程序 常用库:BeautifulSoup"""from bs4 import BeautifulSoupimport urllib.requestfrom os.path import dirname, existsfrom os import makedirs# 获取图片的url连接def getImg(url):
2016-04-14 11:06:27 701
原创 Show me the code之Python练习册 Q11~12 关键词过滤
""" 问题:敏感词文本文件 filtered_words.txt,里面的内容为以下内容,当用户输入敏感词语时,则打印出 Freedom,否则打印出 Human Rights。"""def filterwords(): words = [] f = open('d://filtered_words.txt', 'rb') for l in f.readlines()
2016-04-14 11:05:22 1137
原创 Show me the code之Python练习册 Q10 生成验证码
""" 问题:使用 Python 生成类似于下图中的字母验证码图片"""from PIL import Image, ImageFont, ImageDrawimport random# 图片宽度width = 100# 图片高度height = 40def getcodeimg(): choiceCode = ['1', '2', '3', '4', '5', '6'
2016-04-14 11:03:43 594
原创 Show me the code之Python练习册 Q8~9 html解析
""" 问题:一个HTML文件,找出里面的 正文 常用库:BeautifulSoup 安装pillow库: 1、http://www.lfd.uci.edu/~gohlke/pythonlibs/下载 BeautifulSoup-3.2.1-py2-none-any.whl 2、使用命令pip install BeautifulSoup-3.2.1-py2-n
2016-04-14 09:14:10 664
原创 Show me the code之Python练习册 Q4~7
""" 问题:任一个英文的纯文本文件,统计其中的单词出现的个数。"""import redef count(path): f = open(path, 'r') s = f.read() wcount = re.findall('[\S\w+\b]+', s) print(len(wcount))if __name__ == '__main__':
2016-04-14 09:12:36 579
原创 Show me the code之Python练习册 Q1~3 优惠券
""" 问题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果 常用库:图像处理的库:PIL 安装pillow库: 1、http://www.lfd.uci.edu/~gohlke/pythonlibs/下载 Pillow-3.2.0-cp35-cp35m-win_amd64.whl 2、使用命
2016-04-14 09:08:45 1009
原创 2016年第一季度总结
总结起来只要一句话:一直在扯犊子,从未停下来思考。在浑浑噩噩的度过2015年之后,果然不出所料的工资未涨,绩效低等。但是回顾自己在一季度的工作,比2015年还要不堪。我,我们组甚至都不知道要干什么?并别说什么年度目标,季度目标了?一个季度,三个月的时间,到底做了多少,大家都心里清楚。我现在只希望时间快些走,无论是否能买得起属于自己的房子,只要有了结果,那么我要毫不犹豫的离开,不想再这么耗下
2016-04-13 09:31:41 468
原创 Python3.5爬虫入门示例-获取百度首页及相关的html页面
# crawl.py# 网络爬虫from os import makedirs, unlink, sepfrom os.path import dirname, exists, isdir, splitextimport urllib.requestfrom urllib.parse import urlparsefrom sys import argvimport html.pa
2016-04-12 10:42:07 2155
ubuntu14.04 无线驱动
2015-08-25
memcached作为hibernate二级缓存必备的jar包
2015-02-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人