python urllib模块

时间:2021-04-11 01:17:36

1.urllib.urlopen(url[,data[,proxies]])

urllib.urlopen(url[, data[, proxies]]) :创建一个表示远程url的类文件对象,然后像本地文件一样操作这个类文件对象来获取远程数据。
参数url表示远程数据的路径,一般是网址;
参数data表示以post方式提交到url的数据(玩过web的人应该知道提交数据的两种方式:post与get。如果你不清楚,也不必太在意,一般情况下很少用到这个参数);
参数proxies用于设置代理。

打开一个url的方法,返回一个文件对象,然后可以进行类似文件对象的操作。本例试着打开baidu

 #coding:UTF8

 import urllib
response = urllib.urlopen("http://www.baidu.com")
f = response.readline() #读取html第一行
print f

代码

返回结果

<!DOCTYPE html>

urlopen返回对象提供方法:

-         read() , readline() ,readlines() , fileno() , close() :这些方法的使用方式与文件对象完全一样

-         info():返回一个httplib.HTTPMessage对象,表示远程服务器返回的头信息

-         getcode():返回Http状态码。如果是http请求,200请求成功完成;404网址未找到

-         geturl():返回请求的url

2.urllib.urlretrieve(url[,filename[,reporthook[,data]]])

urlretrieve方法将url定位到的html文件下载到你本地的硬盘中。如果不指定filename,则会存为临时文件。

urlretrieve()返回一个二元组(filename,mine_hdrs)

 #coding:UTF8

 import urllib
response = urllib.urlretrieve("http://www.baidu.com")
print type(response)
print response[0]
print response[1]

临时存放 代码

 <type 'tuple'>
'/tmp/tmp8eVLjq'
Date: Fri, 17 Feb 2017 02:44:05 GMT
Content-Type: text/html; charset=utf-8
Connection: Close
Vary: Accept-Encoding
Set-Cookie: BAIDUID=2B910536110C34E39F7A5D0F0BB0AB8F:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BIDUPSID=2B910536110C34E39F7A5D0F0BB0AB8F; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: PSTM=1487299445; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BDSVRTM=0; path=/
Set-Cookie: BD_HOME=0; path=/
Set-Cookie: H_PS_PSSID=22104_1420_21124_17001_22035; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Cache-Control: private
Cxy_all: baidu+90e29a03609778c29a3b33c9fc46b4a8
Expires: Fri, 17 Feb 2017 02:43:31 GMT
X-Powered-By: HPHP
Server: BWS/1.1
X-UA-Compatible: IE=Edge,chrome=1
BDPAGETYPE: 1
BDQID: 0xdff2399600011aec
BDUSERID: 0

返回结果

 #coding:UTF8

 import urllib
response = urllib.urlretrieve("http://www.baidu.com",filename='E:\google.html')
print type(response)
print response[0]
print response[1]

本地存放 代码

 <type 'tuple'>
E:\google.html
Date: Fri, 17 Feb 2017 02:48:06 GMT
Content-Type: text/html; charset=utf-8
Connection: Close
Vary: Accept-Encoding
Set-Cookie: BAIDUID=3DFE41A42CB005F34AE8BDEF4659A56D:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BIDUPSID=3DFE41A42CB005F34AE8BDEF4659A56D; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: PSTM=1487299686; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BDSVRTM=0; path=/
Set-Cookie: BD_HOME=0; path=/
Set-Cookie: H_PS_PSSID=1457_21112_18559_22036; path=/; domain=.baidu.com
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Cache-Control: private
Cxy_all: baidu+871f7c77ae8fbab47caa28ffbda301bf
Expires: Fri, 17 Feb 2017 02:47:14 GMT
X-Powered-By: HPHP
Server: BWS/1.1
X-UA-Compatible: IE=Edge,chrome=1
BDPAGETYPE: 1
BDQID: 0xc583a986000127e2
BDUSERID: 0

返回结果

3.urllib.urlcleanup()

清除由于urllib.urlretrieve()所产生的缓存

4.urllib.quote(url)和urllib.quote_plus(url)

将url数据获取之后,并将其编码,从而适用与URL字符串中,使其能被打印和被web服务器接受。

 #coding:UTF8

 import urllib
response = urllib.quote("http://www.baidu.com")
res = urllib.quote_plus('http://www.baidu.com') print response
print res

代码

 http%3A//www.baidu.com
http%3A%2F%2Fwww.baidu.com

返回结果

5.urllib.unquote(url)和urllib.unquote_plus(url)

与4的函数相反。

6.urllib.urlencode(query)

将URL中的键值对以连接符&划分

这里可以与urlopen结合以实现post方法和get方法:

GET方法:

 #coding:UTF8

 import urllib
response = urllib.urlencode({'orange':1,'apple':2,'eggs':3})
res = urllib.urlopen("http://python.org/query?%s" % response) print response
print res.read()

代码

 orange=1&eggs=3&apple=2
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="prefetch" href="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"> <meta name="application-name" content="Python.org">
<meta name="msapplication-tooltip" content="The official home of the Python Programming Language">
<meta name="apple-mobile-web-app-title" content="Python.org">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="HandheldFriendly" content="True">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="cleartype" content="on">
<meta http-equiv="imagetoolbar" content="false"> <script src="/static/js/libs/modernizr.js"></script> <link href="/static/stylesheets/style.css" rel="stylesheet" type="text/css" title="default" />
<link href="/static/stylesheets/mq.css" rel="stylesheet" type="text/css" media="not print, braille, embossed, speech, tty" /> <!--[if (lte IE 8)&(!IEMobile)]>
<link href="/static/stylesheets/no-mq.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/static/apple-touch-icon-precomposed.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon-precomposed.png"> <meta name="msapplication-TileImage" content="/static/metro-icon-144x144-precomposed.png"><!-- white shape -->
<meta name="msapplication-TileColor" content="#3673a5"><!-- python blue -->
<meta name="msapplication-navbutton-color" content="#3673a5"> <title>Welcome to Python.org</title> <meta name="description" content="The official home of the Python Programming Language">
<meta name="keywords" content="Python programming language object oriented web free open source software license documentation download community"> <meta property="og:type" content="website">
<meta property="og:site_name" content="Python.org">
<meta property="og:title" content="Welcome to Python.org">
<meta property="og:description" content="The official home of the Python Programming Language"> <meta property="og:image" content="https://www.python.org/static/opengraph-icon-200x200.png">
<meta property="og:image:secure_url" content="https://www.python.org/static/opengraph-icon-200x200.png"> <meta property="og:url" content="https://www.python.org/query?orange=1&amp;eggs=3&amp;apple=2"> <link rel="author" href="/static/humans.txt"> <script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.python.org/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://www.python.org/search/?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script> <script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-39055973-1']);
_gaq.push(['_trackPageview']); (function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script> </head> <body class="python default-page fourohfour"> <div id="touchnav-wrapper"> <div id="nojs" class="do-not-print">
<p><strong>Notice:</strong> While Javascript is not essential for this website, your interaction with the content will be limited. Please turn Javascript on for the full experience. </p>
</div> <!--[if lt IE 8]>
<div id="oldie-warning" class="do-not-print">
<p><strong>Notice:</strong> Your browser is <em>ancient</em> and <a href="http://www.ie6countdown.com/">Microsoft agrees</a>. <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience a better web.</p>
</div>
<![endif]--> <!-- Sister Site Links -->
<div id="top" class="top-bar do-not-print"> <nav class="meta-navigation container" role="navigation"> <div class="skip-link screen-reader-text">
<a href="#content" title="Skip to content">Skip to content</a>
</div> <a id="close-python-network" class="jump-link" href="#python-network" aria-hidden="true">
<span aria-hidden="true" class="icon-arrow-down"><span>&#9660;</span></span> Close
</a> <ul class="menu" role="tree"> <li class="python-meta ">
<a href="/" title="The Python Programming Language" >Python</a>
</li> <li class="psf-meta ">
<a href="/psf-landing/" title="The Python Software Foundation" >PSF</a>
</li> <li class="docs-meta ">
<a href="https://docs.python.org" title="Python Documentation" >Docs</a>
</li> <li class="pypi-meta ">
<a href="https://pypi.python.org/" title="Python Package Index" >PyPI</a>
</li> <li class="jobs-meta ">
<a href="/jobs/" title="Python Job Board" >Jobs</a>
</li> <li class="shop-meta ">
<a href="/community/" title="Python Community" >Community</a>
</li> </ul> <a id="python-network" class="jump-link" href="#top" aria-hidden="true">
<span aria-hidden="true" class="icon-arrow-up"><span>&#9650;</span></span> The Python Network
</a> </nav> </div> <!-- Header elements -->
<header class="main-header" role="banner">
<div class="container"> <h1 class="site-headline">
<a href="/"><img class="python-logo" src="/static/img/python-logo.png" alt="python&trade;"></a>
</h1> <div class="options-bar do-not-print"> <a id="site-map-link" class="jump-to-menu" href="#site-map"><span class="menu-icon">&equiv;</span> Menu</a><form class="search-the-site" action="/search/" method="get">
<fieldset title="Search Python.org"> <span aria-hidden="true" class="icon-search"></span> <label class="screen-reader-text" for="id-search-field">Search This Site</label>
<input id="id-search-field" name="q" type="search" role="textbox" class="search-field" placeholder="Search" value="" tabindex=""> <button type="submit" name="submit" id="submit" class="search-button" title="Submit this Search" tabindex="">
GO
</button> <!--[if IE]><input type="text" style="display: none;" disabled="disabled" size="" tabindex=""><![endif]--> </fieldset>
</form><span class="breaker"></span><div class="adjust-font-size" aria-hidden="true">
<ul class="navigation menu" aria-label="Adjust Text Size on Page">
<li class="tier-1 last" aria-haspopup="true">
<a href="#" class="action-trigger"><strong><small>A</small> A</strong></a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a class="text-shrink" title="Make Text Smaller" href="javascript:;">Smaller</a></li>
<li class="tier-2 element-2" role="treeitem"><a class="text-grow" title="Make Text Larger" href="javascript:;">Larger</a></li>
<li class="tier-2 element-3" role="treeitem"><a class="text-reset" title="Reset any font size changes I have made" href="javascript:;">Reset</a></li>
</ul>
</li>
</ul>
</div><div class="winkwink-nudgenudge">
<ul class="navigation menu" aria-label="Social Media Navigation">
<li class="tier-1 last" aria-haspopup="true">
<a href="#" class="action-trigger">Socialize</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="http://plus.google.com/+Python"><span aria-hidden="true" class="icon-google-plus"></span>Google+</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="http://www.facebook.com/pythonlang?fref=ts"><span aria-hidden="true" class="icon-facebook"></span>Facebook</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="http://twitter.com/ThePSF"><span aria-hidden="true" class="icon-twitter"></span>Twitter</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/community/irc/"><span aria-hidden="true" class="icon-freenode"></span>Chat on IRC</a></li>
</ul>
</li>
</ul>
</div><div class="account-signin">
<ul class="navigation menu" aria-label="Social Media Navigation">
<li class="tier-1 last" aria-haspopup="true"> <a href="/accounts/login/" title="Sign Up or Sign In to Python.org">Sign In</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/accounts/signup/">Sign Up / Register</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/accounts/login/">Sign In</a></li>
</ul> </li>
</ul>
</div> </div><!-- end options-bar --> <nav id="mainnav" class="python-navigation main-navigation do-not-print" role="navigation"> <ul class="navigation menu" role="menubar" aria-label="Main Navigation"> <li id="about" class="tier-1 element-1 " aria-haspopup="true">
<a href="/about/" title="" class="">About</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li> <li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li> </ul> </li> <li id="downloads" class="tier-1 element-2 " aria-haspopup="true">
<a href="/downloads/" title="" class="">Downloads</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li> </ul> </li> <li id="documentation" class="tier-1 element-3 " aria-haspopup="true">
<a href="/doc/" title="" class="">Documentation</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li> <li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner&#39;s Guide</a></li> <li class="tier-2 element-4" role="treeitem"><a href="https://docs.python.org/devguide/" title="">Developer&#39;s Guide</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li> <li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li> <li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li> <li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li> </ul> </li> <li id="community" class="tier-1 element-4 " aria-haspopup="true">
<a href="/community/" title="" class="">Community</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/community/irc/" title="">IRC</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li> <li class="tier-2 element-8" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li> <li class="tier-2 element-9" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li> </ul> </li> <li id="success-stories" class="tier-1 element-5 " aria-haspopup="true">
<a href="/about/success/" title="success-stories" class="">Success Stories</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/about/success/#arts" title="">Arts</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/success/#business" title="">Business</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/success/#education" title="">Education</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/success/#engineering" title="">Engineering</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/about/success/#government" title="">Government</a></li> <li class="tier-2 element-6" role="treeitem"><a href="/about/success/#scientific" title="">Scientific</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/about/success/#software-development" title="">Software Development</a></li> </ul> </li> <li id="news" class="tier-1 element-6 " aria-haspopup="true">
<a href="/blogs/" title="News from around the Python world" class="">News</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li> <li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li> <li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li> <li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li> </ul> </li> <li id="events" class="tier-1 element-7 " aria-haspopup="true">
<a href="/events/" title="" class="">Events</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li> </ul> </li> </ul> </nav> <div class="header-banner "> <!-- for optional "do-not-print" class --> </div> </div><!-- end .container -->
</header> <div id="content" class="content-wrapper">
<!-- Main Content Column -->
<div class="container"> <section class="main-content " role="main"> <article class="text"> <h1 class="giga">Error 404: File not Found</h1> <p>We couldn&rsquo;t find what you were looking for. This error has been reported and we will look into it shortly. For now,</p> <ul>
<li>Try using the search box.</li>
<li>
Python.org went through a redesign and you may have followed a broken link.
Sorry for that, see if <a href="http://legacy.python.org/query">the same page on the legacy website</a> works.
</li>
<li>
Lost in an exotic function call? Read <a href="/doc/">the docs</a>.
Looking for a package? Check the <a href="https://pypi.python.org/">Package Index</a>.
Need a specific version of Python? The <a href="/downloads/">downloads section</a> has it.
</li>
</ul> </article> </section> </div><!-- end .container -->
</div><!-- end #content .content-wrapper --> <!-- Footer and social media list -->
<footer id="site-map" class="main-footer" role="contentinfo">
<div class="main-footer-links">
<div class="container"> <a id="back-to-top-1" class="jump-link" href="#python-network"><span aria-hidden="true" class="icon-arrow-up"><span>&#9650;</span></span> Back to Top</a> <ul class="sitemap navigation menu do-not-print" role="tree" id="container"> <li class="tier-1 element-1">
<a href="/about/" >About</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li> <li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li> </ul> </li> <li class="tier-1 element-2">
<a href="/downloads/" >Downloads</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li> </ul> </li> <li class="tier-1 element-3">
<a href="/doc/" >Documentation</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li> <li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner&#39;s Guide</a></li> <li class="tier-2 element-4" role="treeitem"><a href="https://docs.python.org/devguide/" title="">Developer&#39;s Guide</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li> <li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li> <li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li> <li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li> </ul> </li> <li class="tier-1 element-4">
<a href="/community/" >Community</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/community/irc/" title="">IRC</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li> <li class="tier-2 element-8" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li> <li class="tier-2 element-9" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li> </ul> </li> <li class="tier-1 element-5">
<a href="/about/success/" title="success-stories">Success Stories</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/about/success/#arts" title="">Arts</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/success/#business" title="">Business</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/success/#education" title="">Education</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/success/#engineering" title="">Engineering</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/about/success/#government" title="">Government</a></li> <li class="tier-2 element-6" role="treeitem"><a href="/about/success/#scientific" title="">Scientific</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/about/success/#software-development" title="">Software Development</a></li> </ul> </li> <li class="tier-1 element-6">
<a href="/blogs/" title="News from around the Python world">News</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li> <li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li> <li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li> <li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li> </ul> </li> <li class="tier-1 element-7">
<a href="/events/" >Events</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li> </ul> </li> <li class="tier-1 element-8">
<a href="/dev/" >Contributing</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="http://docs.python.org/devguide/" title="">Developer&#39;s Guide</a></li> <li class="tier-2 element-2" role="treeitem"><a href="http://bugs.python.org/" title="">Issue Tracker</a></li> <li class="tier-2 element-3" role="treeitem"><a href="https://mail.python.org/mailman/listinfo/python-dev" title="">python-dev list</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/dev/core-mentorship/" title="">Core Mentorship</a></li> </ul> </li> </ul> <a id="back-to-top-2" class="jump-link" href="#python-network"><span aria-hidden="true" class="icon-arrow-up"><span>&#9650;</span></span> Back to Top</a> </div><!-- end .container -->
</div> <!-- end .main-footer-links --> <div class="site-base">
<div class="container"> <ul class="footer-links navigation menu do-not-print" role="tree">
<li class="tier-1 element-1"><a href="/about/help/">Help &amp; <span class="say-no-more">General</span> Contact</a></li>
<li class="tier-1 element-2"><a href="/community/diversity/">Diversity <span class="say-no-more">Initiatives</span></a></li>
<li class="tier-1 element-3"><a href="https://github.com/python/pythondotorg/issues">Submit Website Bug</a></li>
<li class="tier-1 element-4">
<a href="https://status.python.org/">Status <span class="python-status-indicator-default" id="python-status-indicator"></span></a>
</li>
</ul> <div class="copyright">
<p><small>
<span class="pre">Copyright &copy;2001-2017.</span>
&nbsp;<span class="pre"><a href="/psf-landing/">Python Software Foundation</a></span>
&nbsp;<span class="pre"><a href="/about/legal/">Legal Statements</a></span>
&nbsp;<span class="pre"><a href="/privacy/">Privacy Policy</a></span>
</small></p>
</div> </div><!-- end .container -->
</div><!-- end .site-base --> </footer> </div><!-- end #touchnav-wrapper --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/static/js/libs/jquery-1.8.2.min.js"><\/script>')</script> <script src="/static/js/libs/masonry.pkgd.min.js"></script> <script type="text/javascript" src="/static/js/main-min.js" charset="utf-8"></script> <!--[if lte IE 7]>
<script type="text/javascript" src="/static/js/plugins/IE8-min.js" charset="utf-8"></script> <![endif]--> <!--[if lte IE 8]>
<script type="text/javascript" src="/static/js/plugins/getComputedStyle-min.js" charset="utf-8"></script> <![endif]--> </body>
</html>

返回结果

POST方法:

 #coding:UTF8

 import urllib
response = urllib.urlencode({'orange':1,'apple':2,'eggs':3})
res = urllib.urlopen("http://python.org/query",response) print response
print res.read()

代码

 orange=1&eggs=3&apple=2
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="prefetch" href="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"> <meta name="application-name" content="Python.org">
<meta name="msapplication-tooltip" content="The official home of the Python Programming Language">
<meta name="apple-mobile-web-app-title" content="Python.org">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="HandheldFriendly" content="True">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="cleartype" content="on">
<meta http-equiv="imagetoolbar" content="false"> <script src="/static/js/libs/modernizr.js"></script> <link href="/static/stylesheets/style.css" rel="stylesheet" type="text/css" title="default" />
<link href="/static/stylesheets/mq.css" rel="stylesheet" type="text/css" media="not print, braille, embossed, speech, tty" /> <!--[if (lte IE 8)&(!IEMobile)]>
<link href="/static/stylesheets/no-mq.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/static/apple-touch-icon-precomposed.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon-precomposed.png"> <meta name="msapplication-TileImage" content="/static/metro-icon-144x144-precomposed.png"><!-- white shape -->
<meta name="msapplication-TileColor" content="#3673a5"><!-- python blue -->
<meta name="msapplication-navbutton-color" content="#3673a5"> <title>Welcome to Python.org</title> <meta name="description" content="The official home of the Python Programming Language">
<meta name="keywords" content="Python programming language object oriented web free open source software license documentation download community"> <meta property="og:type" content="website">
<meta property="og:site_name" content="Python.org">
<meta property="og:title" content="Welcome to Python.org">
<meta property="og:description" content="The official home of the Python Programming Language"> <meta property="og:image" content="https://www.python.org/static/opengraph-icon-200x200.png">
<meta property="og:image:secure_url" content="https://www.python.org/static/opengraph-icon-200x200.png"> <meta property="og:url" content="https://www.python.org/query"> <link rel="author" href="/static/humans.txt"> <script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.python.org/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://www.python.org/search/?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script> <script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-39055973-1']);
_gaq.push(['_trackPageview']); (function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script> </head> <body class="python default-page fourohfour"> <div id="touchnav-wrapper"> <div id="nojs" class="do-not-print">
<p><strong>Notice:</strong> While Javascript is not essential for this website, your interaction with the content will be limited. Please turn Javascript on for the full experience. </p>
</div> <!--[if lt IE 8]>
<div id="oldie-warning" class="do-not-print">
<p><strong>Notice:</strong> Your browser is <em>ancient</em> and <a href="http://www.ie6countdown.com/">Microsoft agrees</a>. <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience a better web.</p>
</div>
<![endif]--> <!-- Sister Site Links -->
<div id="top" class="top-bar do-not-print"> <nav class="meta-navigation container" role="navigation"> <div class="skip-link screen-reader-text">
<a href="#content" title="Skip to content">Skip to content</a>
</div> <a id="close-python-network" class="jump-link" href="#python-network" aria-hidden="true">
<span aria-hidden="true" class="icon-arrow-down"><span>&#9660;</span></span> Close
</a> <ul class="menu" role="tree"> <li class="python-meta ">
<a href="/" title="The Python Programming Language" >Python</a>
</li> <li class="psf-meta ">
<a href="/psf-landing/" title="The Python Software Foundation" >PSF</a>
</li> <li class="docs-meta ">
<a href="https://docs.python.org" title="Python Documentation" >Docs</a>
</li> <li class="pypi-meta ">
<a href="https://pypi.python.org/" title="Python Package Index" >PyPI</a>
</li> <li class="jobs-meta ">
<a href="/jobs/" title="Python Job Board" >Jobs</a>
</li> <li class="shop-meta ">
<a href="/community/" title="Python Community" >Community</a>
</li> </ul> <a id="python-network" class="jump-link" href="#top" aria-hidden="true">
<span aria-hidden="true" class="icon-arrow-up"><span>&#9650;</span></span> The Python Network
</a> </nav> </div> <!-- Header elements -->
<header class="main-header" role="banner">
<div class="container"> <h1 class="site-headline">
<a href="/"><img class="python-logo" src="/static/img/python-logo.png" alt="python&trade;"></a>
</h1> <div class="options-bar do-not-print"> <a id="site-map-link" class="jump-to-menu" href="#site-map"><span class="menu-icon">&equiv;</span> Menu</a><form class="search-the-site" action="/search/" method="get">
<fieldset title="Search Python.org"> <span aria-hidden="true" class="icon-search"></span> <label class="screen-reader-text" for="id-search-field">Search This Site</label>
<input id="id-search-field" name="q" type="search" role="textbox" class="search-field" placeholder="Search" value="" tabindex=""> <button type="submit" name="submit" id="submit" class="search-button" title="Submit this Search" tabindex="">
GO
</button> <!--[if IE]><input type="text" style="display: none;" disabled="disabled" size="" tabindex=""><![endif]--> </fieldset>
</form><span class="breaker"></span><div class="adjust-font-size" aria-hidden="true">
<ul class="navigation menu" aria-label="Adjust Text Size on Page">
<li class="tier-1 last" aria-haspopup="true">
<a href="#" class="action-trigger"><strong><small>A</small> A</strong></a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a class="text-shrink" title="Make Text Smaller" href="javascript:;">Smaller</a></li>
<li class="tier-2 element-2" role="treeitem"><a class="text-grow" title="Make Text Larger" href="javascript:;">Larger</a></li>
<li class="tier-2 element-3" role="treeitem"><a class="text-reset" title="Reset any font size changes I have made" href="javascript:;">Reset</a></li>
</ul>
</li>
</ul>
</div><div class="winkwink-nudgenudge">
<ul class="navigation menu" aria-label="Social Media Navigation">
<li class="tier-1 last" aria-haspopup="true">
<a href="#" class="action-trigger">Socialize</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="http://plus.google.com/+Python"><span aria-hidden="true" class="icon-google-plus"></span>Google+</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="http://www.facebook.com/pythonlang?fref=ts"><span aria-hidden="true" class="icon-facebook"></span>Facebook</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="http://twitter.com/ThePSF"><span aria-hidden="true" class="icon-twitter"></span>Twitter</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/community/irc/"><span aria-hidden="true" class="icon-freenode"></span>Chat on IRC</a></li>
</ul>
</li>
</ul>
</div><div class="account-signin">
<ul class="navigation menu" aria-label="Social Media Navigation">
<li class="tier-1 last" aria-haspopup="true"> <a href="/accounts/login/" title="Sign Up or Sign In to Python.org">Sign In</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/accounts/signup/">Sign Up / Register</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/accounts/login/">Sign In</a></li>
</ul> </li>
</ul>
</div> </div><!-- end options-bar --> <nav id="mainnav" class="python-navigation main-navigation do-not-print" role="navigation"> <ul class="navigation menu" role="menubar" aria-label="Main Navigation"> <li id="about" class="tier-1 element-1 " aria-haspopup="true">
<a href="/about/" title="" class="">About</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li> <li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li> </ul> </li> <li id="downloads" class="tier-1 element-2 " aria-haspopup="true">
<a href="/downloads/" title="" class="">Downloads</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li> </ul> </li> <li id="documentation" class="tier-1 element-3 " aria-haspopup="true">
<a href="/doc/" title="" class="">Documentation</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li> <li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner&#39;s Guide</a></li> <li class="tier-2 element-4" role="treeitem"><a href="https://docs.python.org/devguide/" title="">Developer&#39;s Guide</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li> <li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li> <li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li> <li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li> </ul> </li> <li id="community" class="tier-1 element-4 " aria-haspopup="true">
<a href="/community/" title="" class="">Community</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/community/irc/" title="">IRC</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li> <li class="tier-2 element-8" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li> <li class="tier-2 element-9" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li> </ul> </li> <li id="success-stories" class="tier-1 element-5 " aria-haspopup="true">
<a href="/about/success/" title="success-stories" class="">Success Stories</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/about/success/#arts" title="">Arts</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/success/#business" title="">Business</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/success/#education" title="">Education</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/success/#engineering" title="">Engineering</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/about/success/#government" title="">Government</a></li> <li class="tier-2 element-6" role="treeitem"><a href="/about/success/#scientific" title="">Scientific</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/about/success/#software-development" title="">Software Development</a></li> </ul> </li> <li id="news" class="tier-1 element-6 " aria-haspopup="true">
<a href="/blogs/" title="News from around the Python world" class="">News</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li> <li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li> <li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li> <li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li> </ul> </li> <li id="events" class="tier-1 element-7 " aria-haspopup="true">
<a href="/events/" title="" class="">Events</a> <ul class="subnav menu" role="menu" aria-hidden="true"> <li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li> </ul> </li> </ul> </nav> <div class="header-banner "> <!-- for optional "do-not-print" class --> </div> </div><!-- end .container -->
</header> <div id="content" class="content-wrapper">
<!-- Main Content Column -->
<div class="container"> <section class="main-content " role="main"> <article class="text"> <h1 class="giga">Error 404: File not Found</h1> <p>We couldn&rsquo;t find what you were looking for. This error has been reported and we will look into it shortly. For now,</p> <ul>
<li>Try using the search box.</li>
<li>
Python.org went through a redesign and you may have followed a broken link.
Sorry for that, see if <a href="http://legacy.python.org/query">the same page on the legacy website</a> works.
</li>
<li>
Lost in an exotic function call? Read <a href="/doc/">the docs</a>.
Looking for a package? Check the <a href="https://pypi.python.org/">Package Index</a>.
Need a specific version of Python? The <a href="/downloads/">downloads section</a> has it.
</li>
</ul> </article> </section> </div><!-- end .container -->
</div><!-- end #content .content-wrapper --> <!-- Footer and social media list -->
<footer id="site-map" class="main-footer" role="contentinfo">
<div class="main-footer-links">
<div class="container"> <a id="back-to-top-1" class="jump-link" href="#python-network"><span aria-hidden="true" class="icon-arrow-up"><span>&#9650;</span></span> Back to Top</a> <ul class="sitemap navigation menu do-not-print" role="tree" id="container"> <li class="tier-1 element-1">
<a href="/about/" >About</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li> <li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li> </ul> </li> <li class="tier-1 element-2">
<a href="/downloads/" >Downloads</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li> </ul> </li> <li class="tier-1 element-3">
<a href="/doc/" >Documentation</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li> <li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner&#39;s Guide</a></li> <li class="tier-2 element-4" role="treeitem"><a href="https://docs.python.org/devguide/" title="">Developer&#39;s Guide</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li> <li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li> <li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li> <li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li> </ul> </li> <li class="tier-1 element-4">
<a href="/community/" >Community</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/community/irc/" title="">IRC</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li> <li class="tier-2 element-6" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li> <li class="tier-2 element-8" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li> <li class="tier-2 element-9" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li> </ul> </li> <li class="tier-1 element-5">
<a href="/about/success/" title="success-stories">Success Stories</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/about/success/#arts" title="">Arts</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/about/success/#business" title="">Business</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/about/success/#education" title="">Education</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/about/success/#engineering" title="">Engineering</a></li> <li class="tier-2 element-5" role="treeitem"><a href="/about/success/#government" title="">Government</a></li> <li class="tier-2 element-6" role="treeitem"><a href="/about/success/#scientific" title="">Scientific</a></li> <li class="tier-2 element-7" role="treeitem"><a href="/about/success/#software-development" title="">Software Development</a></li> </ul> </li> <li class="tier-1 element-6">
<a href="/blogs/" title="News from around the Python world">News</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li> <li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li> <li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li> <li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li> </ul> </li> <li class="tier-1 element-7">
<a href="/events/" >Events</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li> <li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li> <li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li> <li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li> </ul> </li> <li class="tier-1 element-8">
<a href="/dev/" >Contributing</a> <ul class="subnav menu"> <li class="tier-2 element-1" role="treeitem"><a href="http://docs.python.org/devguide/" title="">Developer&#39;s Guide</a></li> <li class="tier-2 element-2" role="treeitem"><a href="http://bugs.python.org/" title="">Issue Tracker</a></li> <li class="tier-2 element-3" role="treeitem"><a href="https://mail.python.org/mailman/listinfo/python-dev" title="">python-dev list</a></li> <li class="tier-2 element-4" role="treeitem"><a href="/dev/core-mentorship/" title="">Core Mentorship</a></li> </ul> </li> </ul> <a id="back-to-top-2" class="jump-link" href="#python-network"><span aria-hidden="true" class="icon-arrow-up"><span>&#9650;</span></span> Back to Top</a> </div><!-- end .container -->
</div> <!-- end .main-footer-links --> <div class="site-base">
<div class="container"> <ul class="footer-links navigation menu do-not-print" role="tree">
<li class="tier-1 element-1"><a href="/about/help/">Help &amp; <span class="say-no-more">General</span> Contact</a></li>
<li class="tier-1 element-2"><a href="/community/diversity/">Diversity <span class="say-no-more">Initiatives</span></a></li>
<li class="tier-1 element-3"><a href="https://github.com/python/pythondotorg/issues">Submit Website Bug</a></li>
<li class="tier-1 element-4">
<a href="https://status.python.org/">Status <span class="python-status-indicator-default" id="python-status-indicator"></span></a>
</li>
</ul> <div class="copyright">
<p><small>
<span class="pre">Copyright &copy;2001-2017.</span>
&nbsp;<span class="pre"><a href="/psf-landing/">Python Software Foundation</a></span>
&nbsp;<span class="pre"><a href="/about/legal/">Legal Statements</a></span>
&nbsp;<span class="pre"><a href="/privacy/">Privacy Policy</a></span>
</small></p>
</div> </div><!-- end .container -->
</div><!-- end .site-base --> </footer> </div><!-- end #touchnav-wrapper --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/static/js/libs/jquery-1.8.2.min.js"><\/script>')</script> <script src="/static/js/libs/masonry.pkgd.min.js"></script> <script type="text/javascript" src="/static/js/main-min.js" charset="utf-8"></script> <!--[if lte IE 7]>
<script type="text/javascript" src="/static/js/plugins/IE8-min.js" charset="utf-8"></script> <![endif]--> <!--[if lte IE 8]>
<script type="text/javascript" src="/static/js/plugins/getComputedStyle-min.js" charset="utf-8"></script> <![endif]--> </body>
</html>

返回结果