Python网络资源 + Python Manual

如何学习Python + 如何有效利用Python有关的网络资源 + 如何利用Python自带手册(Python Manual)

【整理】总结Python2(Python 2.x版本)和Python3(Python 3.x版本)之间的区别html

而后根据状况,选择本身须要的python版本,而后才涉及到,如何学习的问题。java

 

【学习Python的基本流程】python

1.先学习Python的基础知识编程

推荐资料:windows

Dive Into Python网络

中文主页是:app

http://woodpecker.org.cn/diveintopython/框架

 

能够在线看:ide

深刻 Python :Dive Into Python 中文版函数

也能够下载各类格式:

留本地看。 

 

1. Python的第三方库

python的第三方库,数量巨大,功能巨多,可是正是因为太多,不可能一一总结。

可是python官网,人家已经整理出来了,都放到这里了:

http://pypi.python.org/pypi?%3Aaction=index

该页面因为库太多,看着很不方便。

这里有分类查看:

http://pypi.python.org/pypi?%3Aaction=browse 

若是须要某些方面的功能,能够去上述两个地址中,找找有没有现成的库,若是有的话,直接拿过来用,比你从头开发,要高效的多。

 

2. 各类Python的总结方面的资料

其中包括我写的Python语言总结,其中主要分两块:

(1)python学习心得和体会

总结了本身折腾python过程当中的一些理解,和一些细节方面的注意事项。

(2)crifan的Python库:crifanLib.py

本身把一些经常使用的Python的函数,整理出来,供本身和别人使用。

尤为是不少网络方面的函数,等你用到了,就会知道会省你很多精力的。

 

【如何利用Python自带手册 Python Manual】

其中,关于查参考资料,特别要提示的一点是,对于不少不熟悉的python函数,最佳的学习方法,我的认为是先去Python自带手册中去查找。

而Python自带手册,是你安装好Python以后,(个人是windows环境,经过exe安装的python 2.7版的),能够经过开始->Python 27-> Python Mannuals:

python manual

 

好比涉及到网络编程,须要用到urllib2这个模块,想要搞懂urllib2。

那么第一步,就能够先去经过manual找到urllib2:

find urllib2

而后再去看看其语法:

urllib2. urlopen (url[, data][, timeout] )
Open the URL url, which can be either a string or a  Request object.

Warning

HTTPS requests do not do any verification of the server’s certificate.

data may be a string specifying additional data to send to the server, or None if no such data is needed. Currently HTTP requests are the only ones that use data; the HTTP request will be a POST instead of a GET when the data parameter is provided. data should be a buffer in the standard application/x-www-form-urlencoded format. The urllib.urlencode() function takes a mapping or sequence of 2-tuples and returns a string in this format. urllib2 module sends HTTP/1.1 requests withCONNECTION:CLOSEheader included.

The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used). This actually only works for HTTP, HTTPS and FTP connections.

This function returns a file-like object with two additional methods:

  • geturl() — return the URL of the resource retrieved, commonly used to determine if a redirect was followed
  • info() — return the meta-information of the page, such as headers, in the form of an mimetools.Message instance (see Quick Reference to HTTP Headers)

Raises URLError on errors.

Note that None may be returned if no handler handles the request (though the default installed global OpenerDirector uses UnknownHandler to ensure this never happens).

In addition, default installed ProxyHandler makes sure the requests are handled through the proxy when they are set.

Changed in version 2.6: timeout was added.

如此,对于其有个基本的了解后,再去网上详细看看别人的示例代码。

这样,有助于你快速,准确的,学习此库函数。

至少,我对于不少不少的python内置库函数,都是这样慢慢逐渐学习和了解的。

 

 

相关文章
相关标签/搜索