![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 51
shikun520
这个作者很懒,什么都没留下…
展开
-
python3.x 的urllib使用例子
2.x版本的python可以直接使用import urllib来进行操作,但是3.x版本的python使用的是import urllib.request来进行操作,下面是简单的例子:===============================================================================# get code of given URL a...原创 2014-12-31 16:26:03 · 175 阅读 · 0 评论 -
Python 字典替代case
# python code: dosomething = { 'A': dosomethingofA, 'B': dosomethingofB, None: dosomethingofDefault,} dosomething.get(c,dosomething[None])()原创 2015-01-04 14:18:40 · 214 阅读 · 0 评论 -
python 测试网页
·思路简介: 时间是关键, 如果能抓准服务器的时间, 可以说胜算将得到很大的提高, 如何抓取服务器时间? 我们知道在通过HTTP对服务器发起请求时, 在响应的服务器头文件中包含所请求网页的相关条件信息, 其中有个Date头域, 里面记录着相关的时间, 我们就通过这个来获取cnblogs的服务器时间。#!/usr/bin/python#-----------------------...原创 2015-01-06 19:14:16 · 367 阅读 · 0 评论