码迷,mamicode.com
首页 > 编程语言 > 详细

python学习笔记 (二)

时间:2015-10-16 13:08:23      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

The urllib and urllib2 Modules

For simple downloads, urllib is quite all right. If you need HTTP authentication or cookies, or you want to write extensions to handle your own portocols, then urllib2 might be the right choice for you.

The urlopen function gives you a file-like object you can read from. If you would rather have urllib take care of downloading the file for you, storing a copy in a local file, you can use urlretrieve instead. 

 

 

doctest , unittest 

"Make it work, make it better, make it faster" : The unit testing helped make it work; source code checking can make it better; and, finally, profilling can help make it faster.

source code checking with PyChecker and PyLint

python学习笔记 (二)

标签:

原文地址:http://www.cnblogs.com/linxd/p/4884813.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!