Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-backports > by-pkgid > 3ba3bd1608c672ba2129b098a48e9e4d > files > 735

python3-docs-3.2.2-3mdv2010.2.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>18.5. mimetypes — Map filenames to MIME types &mdash; Python v3.2.2 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '3.2.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python v3.2.2 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python v3.2.2 documentation" href="../index.html" />
    <link rel="up" title="18. Internet Data Handling" href="netdata.html" />
    <link rel="next" title="18.6. base64 — RFC 3548: Base16, Base32, Base64 Data Encodings" href="base64.html" />
    <link rel="prev" title="18.4. mailbox — Manipulate mailboxes in various formats" href="mailbox.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="base64.html" title="18.6. base64 — RFC 3548: Base16, Base32, Base64 Data Encodings"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="mailbox.html" title="18.4. mailbox — Manipulate mailboxes in various formats"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v3.2.2 documentation</a> &raquo;</li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="netdata.html" accesskey="U">18. Internet Data Handling</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-mimetypes">
<span id="mimetypes-map-filenames-to-mime-types"></span><h1>18.5. <a class="reference internal" href="#module-mimetypes" title="mimetypes: Mapping of filename extensions to MIME types."><tt class="xref py py-mod docutils literal"><span class="pre">mimetypes</span></tt></a> &#8212; Map filenames to MIME types<a class="headerlink" href="#module-mimetypes" title="Permalink to this headline">¶</a></h1>
<p id="index-0"><strong>Source code:</strong> <a class="reference external" href="http://hg.python.org/cpython/file/3.2/Lib/mimetypes.py">Lib/mimetypes.py</a></p>
<hr class="docutils" />
<p>The <a class="reference internal" href="#module-mimetypes" title="mimetypes: Mapping of filename extensions to MIME types."><tt class="xref py py-mod docutils literal"><span class="pre">mimetypes</span></tt></a> module converts between a filename or URL and the MIME type
associated with the filename extension.  Conversions are provided from filename
to MIME type and from MIME type to filename extension; encodings are not
supported for the latter conversion.</p>
<p>The module provides one class and a number of convenience functions. The
functions are the normal interface to this module, but some applications may be
interested in the class as well.</p>
<p>The functions described below provide the primary interface for this module.  If
the module has not been initialized, they will call <a class="reference internal" href="#mimetypes.init" title="mimetypes.init"><tt class="xref py py-func docutils literal"><span class="pre">init()</span></tt></a> if they rely on
the information <a class="reference internal" href="#mimetypes.init" title="mimetypes.init"><tt class="xref py py-func docutils literal"><span class="pre">init()</span></tt></a> sets up.</p>
<dl class="function">
<dt id="mimetypes.guess_type">
<tt class="descclassname">mimetypes.</tt><tt class="descname">guess_type</tt><big>(</big><em>url</em>, <em>strict=True</em><big>)</big><a class="headerlink" href="#mimetypes.guess_type" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-1">Guess the type of a file based on its filename or URL, given by <em>filename</em>.  The
return value is a tuple <tt class="docutils literal"><span class="pre">(type,</span> <span class="pre">encoding)</span></tt> where <em>type</em> is <tt class="xref docutils literal"><span class="pre">None</span></tt> if the
type can&#8217;t be guessed (missing or unknown suffix) or a string of the form
<tt class="docutils literal"><span class="pre">'type/subtype'</span></tt>, usable for a MIME <em class="mailheader">content-type</em> header.</p>
<p><em>encoding</em> is <tt class="xref docutils literal"><span class="pre">None</span></tt> for no encoding or the name of the program used to encode
(e.g. <strong class="program">compress</strong> or <strong class="program">gzip</strong>). The encoding is suitable for use
as a <em class="mailheader">Content-Encoding</em> header, <em>not</em> as a
<em class="mailheader">Content-Transfer-Encoding</em> header. The mappings are table driven.
Encoding suffixes are case sensitive; type suffixes are first tried case
sensitively, then case insensitively.</p>
<p>Optional <em>strict</em> is a flag specifying whether the list of known MIME types
is limited to only the official types <a class="reference external" href="http://www.iana.org/assignments/media-types/">registered with IANA</a> are recognized.
When <em>strict</em> is true (the default), only the IANA types are supported; when
<em>strict</em> is false, some additional non-standard but commonly used MIME types
are also recognized.</p>
</dd></dl>

<dl class="function">
<dt id="mimetypes.guess_all_extensions">
<tt class="descclassname">mimetypes.</tt><tt class="descname">guess_all_extensions</tt><big>(</big><em>type</em>, <em>strict=True</em><big>)</big><a class="headerlink" href="#mimetypes.guess_all_extensions" title="Permalink to this definition">¶</a></dt>
<dd><p>Guess the extensions for a file based on its MIME type, given by <em>type</em>. The
return value is a list of strings giving all possible filename extensions,
including the leading dot (<tt class="docutils literal"><span class="pre">'.'</span></tt>).  The extensions are not guaranteed to have
been associated with any particular data stream, but would be mapped to the MIME
type <em>type</em> by <a class="reference internal" href="#mimetypes.guess_type" title="mimetypes.guess_type"><tt class="xref py py-func docutils literal"><span class="pre">guess_type()</span></tt></a>.</p>
<p>Optional <em>strict</em> has the same meaning as with the <a class="reference internal" href="#mimetypes.guess_type" title="mimetypes.guess_type"><tt class="xref py py-func docutils literal"><span class="pre">guess_type()</span></tt></a> function.</p>
</dd></dl>

<dl class="function">
<dt id="mimetypes.guess_extension">
<tt class="descclassname">mimetypes.</tt><tt class="descname">guess_extension</tt><big>(</big><em>type</em>, <em>strict=True</em><big>)</big><a class="headerlink" href="#mimetypes.guess_extension" title="Permalink to this definition">¶</a></dt>
<dd><p>Guess the extension for a file based on its MIME type, given by <em>type</em>. The
return value is a string giving a filename extension, including the leading dot
(<tt class="docutils literal"><span class="pre">'.'</span></tt>).  The extension is not guaranteed to have been associated with any
particular data stream, but would be mapped to the  MIME type <em>type</em> by
<a class="reference internal" href="#mimetypes.guess_type" title="mimetypes.guess_type"><tt class="xref py py-func docutils literal"><span class="pre">guess_type()</span></tt></a>.  If no extension can be guessed for <em>type</em>, <tt class="xref docutils literal"><span class="pre">None</span></tt> is
returned.</p>
<p>Optional <em>strict</em> has the same meaning as with the <a class="reference internal" href="#mimetypes.guess_type" title="mimetypes.guess_type"><tt class="xref py py-func docutils literal"><span class="pre">guess_type()</span></tt></a> function.</p>
</dd></dl>

<p>Some additional functions and data items are available for controlling the
behavior of the module.</p>
<dl class="function">
<dt id="mimetypes.init">
<tt class="descclassname">mimetypes.</tt><tt class="descname">init</tt><big>(</big><em>files=None</em><big>)</big><a class="headerlink" href="#mimetypes.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize the internal data structures.  If given, <em>files</em> must be a sequence
of file names which should be used to augment the default type map.  If omitted,
the file names to use are taken from <a class="reference internal" href="#mimetypes.knownfiles" title="mimetypes.knownfiles"><tt class="xref py py-const docutils literal"><span class="pre">knownfiles</span></tt></a>; on Windows, the
current registry settings are loaded.  Each file named in <em>files</em> or
<a class="reference internal" href="#mimetypes.knownfiles" title="mimetypes.knownfiles"><tt class="xref py py-const docutils literal"><span class="pre">knownfiles</span></tt></a> takes precedence over those named before it.  Calling
<a class="reference internal" href="#mimetypes.init" title="mimetypes.init"><tt class="xref py py-func docutils literal"><span class="pre">init()</span></tt></a> repeatedly is allowed.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 3.2: </span>Previously, Windows registry settings were ignored.</p>
</dd></dl>

<dl class="function">
<dt id="mimetypes.read_mime_types">
<tt class="descclassname">mimetypes.</tt><tt class="descname">read_mime_types</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#mimetypes.read_mime_types" title="Permalink to this definition">¶</a></dt>
<dd><p>Load the type map given in the file <em>filename</em>, if it exists.  The  type map is
returned as a dictionary mapping filename extensions, including the leading dot
(<tt class="docutils literal"><span class="pre">'.'</span></tt>), to strings of the form <tt class="docutils literal"><span class="pre">'type/subtype'</span></tt>.  If the file <em>filename</em>
does not exist or cannot be read, <tt class="xref docutils literal"><span class="pre">None</span></tt> is returned.</p>
</dd></dl>

<dl class="function">
<dt id="mimetypes.add_type">
<tt class="descclassname">mimetypes.</tt><tt class="descname">add_type</tt><big>(</big><em>type</em>, <em>ext</em>, <em>strict=True</em><big>)</big><a class="headerlink" href="#mimetypes.add_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a mapping from the mimetype <em>type</em> to the extension <em>ext</em>. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of known extensions.</p>
<p>When <em>strict</em> is True (the default), the mapping will added to the official MIME
types, otherwise to the non-standard ones.</p>
</dd></dl>

<dl class="data">
<dt id="mimetypes.inited">
<tt class="descclassname">mimetypes.</tt><tt class="descname">inited</tt><a class="headerlink" href="#mimetypes.inited" title="Permalink to this definition">¶</a></dt>
<dd><p>Flag indicating whether or not the global data structures have been initialized.
This is set to true by <a class="reference internal" href="#mimetypes.init" title="mimetypes.init"><tt class="xref py py-func docutils literal"><span class="pre">init()</span></tt></a>.</p>
</dd></dl>

<dl class="data">
<dt id="mimetypes.knownfiles">
<tt class="descclassname">mimetypes.</tt><tt class="descname">knownfiles</tt><a class="headerlink" href="#mimetypes.knownfiles" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-2">List of type map file names commonly installed.  These files are typically named
<tt class="file docutils literal"><span class="pre">mime.types</span></tt> and are installed in different locations by different
packages.</p>
</dd></dl>

<dl class="data">
<dt id="mimetypes.suffix_map">
<tt class="descclassname">mimetypes.</tt><tt class="descname">suffix_map</tt><a class="headerlink" href="#mimetypes.suffix_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping suffixes to suffixes.  This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension.  For example, the <tt class="file docutils literal"><span class="pre">.tgz</span></tt> extension is mapped to <tt class="file docutils literal"><span class="pre">.tar.gz</span></tt>
to allow the encoding and type to be recognized separately.</p>
</dd></dl>

<dl class="data">
<dt id="mimetypes.encodings_map">
<tt class="descclassname">mimetypes.</tt><tt class="descname">encodings_map</tt><a class="headerlink" href="#mimetypes.encodings_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping filename extensions to encoding types.</p>
</dd></dl>

<dl class="data">
<dt id="mimetypes.types_map">
<tt class="descclassname">mimetypes.</tt><tt class="descname">types_map</tt><a class="headerlink" href="#mimetypes.types_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping filename extensions to MIME types.</p>
</dd></dl>

<dl class="data">
<dt id="mimetypes.common_types">
<tt class="descclassname">mimetypes.</tt><tt class="descname">common_types</tt><a class="headerlink" href="#mimetypes.common_types" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping filename extensions to non-standard, but commonly found MIME
types.</p>
</dd></dl>

<p>The <a class="reference internal" href="#mimetypes.MimeTypes" title="mimetypes.MimeTypes"><tt class="xref py py-class docutils literal"><span class="pre">MimeTypes</span></tt></a> class may be useful for applications which may want more
than one MIME-type database:</p>
<dl class="class">
<dt id="mimetypes.MimeTypes">
<em class="property">class </em><tt class="descclassname">mimetypes.</tt><tt class="descname">MimeTypes</tt><big>(</big><em>filenames=()</em>, <em>strict=True</em><big>)</big><a class="headerlink" href="#mimetypes.MimeTypes" title="Permalink to this definition">¶</a></dt>
<dd><p>This class represents a MIME-types database.  By default, it provides access to
the same database as the rest of this module. The initial database is a copy of
that provided by the module, and may be extended by loading additional
<tt class="file docutils literal"><span class="pre">mime.types</span></tt>-style files into the database using the <a class="reference internal" href="#mimetypes.MimeTypes.read" title="mimetypes.MimeTypes.read"><tt class="xref py py-meth docutils literal"><span class="pre">read()</span></tt></a> or
<a class="reference internal" href="#mimetypes.MimeTypes.readfp" title="mimetypes.MimeTypes.readfp"><tt class="xref py py-meth docutils literal"><span class="pre">readfp()</span></tt></a> methods.  The mapping dictionaries may also be cleared before
loading additional data if the default data is not desired.</p>
<p>The optional <em>filenames</em> parameter can be used to cause additional files to be
loaded &#8220;on top&#8221; of the default database.</p>
</dd></dl>

<p>An example usage of the module:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">mimetypes</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mimetypes</span><span class="o">.</span><span class="n">init</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mimetypes</span><span class="o">.</span><span class="n">knownfiles</span>
<span class="go">[&#39;/etc/mime.types&#39;, &#39;/etc/httpd/mime.types&#39;, ... ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mimetypes</span><span class="o">.</span><span class="n">suffix_map</span><span class="p">[</span><span class="s">&#39;.tgz&#39;</span><span class="p">]</span>
<span class="go">&#39;.tar.gz&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mimetypes</span><span class="o">.</span><span class="n">encodings_map</span><span class="p">[</span><span class="s">&#39;.gz&#39;</span><span class="p">]</span>
<span class="go">&#39;gzip&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mimetypes</span><span class="o">.</span><span class="n">types_map</span><span class="p">[</span><span class="s">&#39;.tgz&#39;</span><span class="p">]</span>
<span class="go">&#39;application/x-tar-gz&#39;</span>
</pre></div>
</div>
<div class="section" id="mimetypes-objects">
<span id="id1"></span><h2>18.5.1. MimeTypes Objects<a class="headerlink" href="#mimetypes-objects" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="#mimetypes.MimeTypes" title="mimetypes.MimeTypes"><tt class="xref py py-class docutils literal"><span class="pre">MimeTypes</span></tt></a> instances provide an interface which is very like that of the
<a class="reference internal" href="#module-mimetypes" title="mimetypes: Mapping of filename extensions to MIME types."><tt class="xref py py-mod docutils literal"><span class="pre">mimetypes</span></tt></a> module.</p>
<dl class="attribute">
<dt id="mimetypes.MimeTypes.suffix_map">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">suffix_map</tt><a class="headerlink" href="#mimetypes.MimeTypes.suffix_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping suffixes to suffixes.  This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension.  For example, the <tt class="file docutils literal"><span class="pre">.tgz</span></tt> extension is mapped to <tt class="file docutils literal"><span class="pre">.tar.gz</span></tt>
to allow the encoding and type to be recognized separately.  This is initially a
copy of the global <tt class="docutils literal"><span class="pre">suffix_map</span></tt> defined in the module.</p>
</dd></dl>

<dl class="attribute">
<dt id="mimetypes.MimeTypes.encodings_map">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">encodings_map</tt><a class="headerlink" href="#mimetypes.MimeTypes.encodings_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping filename extensions to encoding types.  This is initially a
copy of the global <tt class="docutils literal"><span class="pre">encodings_map</span></tt> defined in the module.</p>
</dd></dl>

<dl class="attribute">
<dt id="mimetypes.MimeTypes.types_map">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">types_map</tt><a class="headerlink" href="#mimetypes.MimeTypes.types_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping filename extensions to MIME types.  This is initially a copy
of the global <tt class="docutils literal"><span class="pre">types_map</span></tt> defined in the module.</p>
</dd></dl>

<dl class="attribute">
<dt id="mimetypes.MimeTypes.common_types">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">common_types</tt><a class="headerlink" href="#mimetypes.MimeTypes.common_types" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping filename extensions to non-standard, but commonly found MIME
types.  This is initially a copy of the global <tt class="docutils literal"><span class="pre">common_types</span></tt> defined in the
module.</p>
</dd></dl>

<dl class="method">
<dt id="mimetypes.MimeTypes.guess_extension">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">guess_extension</tt><big>(</big><em>type</em>, <em>strict=True</em><big>)</big><a class="headerlink" href="#mimetypes.MimeTypes.guess_extension" title="Permalink to this definition">¶</a></dt>
<dd><p>Similar to the <a class="reference internal" href="#mimetypes.guess_extension" title="mimetypes.guess_extension"><tt class="xref py py-func docutils literal"><span class="pre">guess_extension()</span></tt></a> function, using the tables stored as part
of the object.</p>
</dd></dl>

<dl class="method">
<dt id="mimetypes.MimeTypes.guess_type">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">guess_type</tt><big>(</big><em>url</em>, <em>strict=True</em><big>)</big><a class="headerlink" href="#mimetypes.MimeTypes.guess_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Similar to the <a class="reference internal" href="#mimetypes.guess_type" title="mimetypes.guess_type"><tt class="xref py py-func docutils literal"><span class="pre">guess_type()</span></tt></a> function, using the tables stored as part of
the object.</p>
</dd></dl>

<dl class="method">
<dt id="mimetypes.MimeTypes.read">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">read</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#mimetypes.MimeTypes.read" title="Permalink to this definition">¶</a></dt>
<dd><p>Load MIME information from a file named <em>path</em>.  This uses <a class="reference internal" href="#mimetypes.MimeTypes.readfp" title="mimetypes.MimeTypes.readfp"><tt class="xref py py-meth docutils literal"><span class="pre">readfp()</span></tt></a> to
parse the file.</p>
</dd></dl>

<dl class="method">
<dt id="mimetypes.MimeTypes.readfp">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">readfp</tt><big>(</big><em>file</em><big>)</big><a class="headerlink" href="#mimetypes.MimeTypes.readfp" title="Permalink to this definition">¶</a></dt>
<dd><p>Load MIME type information from an open file.  The file must have the format of
the standard <tt class="file docutils literal"><span class="pre">mime.types</span></tt> files.</p>
</dd></dl>

<dl class="method">
<dt id="mimetypes.MimeTypes.read_windows_registry">
<tt class="descclassname">MimeTypes.</tt><tt class="descname">read_windows_registry</tt><big>(</big><big>)</big><a class="headerlink" href="#mimetypes.MimeTypes.read_windows_registry" title="Permalink to this definition">¶</a></dt>
<dd><p>Load MIME type information from the Windows registry.  Availability: Windows.</p>
<p class="versionadded">
<span class="versionmodified">New in version 3.2.</span></p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">18.5. <tt class="docutils literal"><span class="pre">mimetypes</span></tt> &#8212; Map filenames to MIME types</a><ul>
<li><a class="reference internal" href="#mimetypes-objects">18.5.1. MimeTypes Objects</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="mailbox.html"
                        title="previous chapter">18.4. <tt class="docutils literal docutils literal docutils literal"><span class="pre">mailbox</span></tt> &#8212; Manipulate mailboxes in various formats</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="base64.html"
                        title="next chapter">18.6. <tt class="docutils literal docutils literal docutils literal"><span class="pre">base64</span></tt> &#8212; RFC 3548: Base16, Base32, Base64 Data Encodings</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
  <li><a href="../bugs.html">Report a Bug</a></li>
  <li><a href="../_sources/library/mimetypes.txt"
         rel="nofollow">Show Source</a></li>
</ul>

<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="base64.html" title="18.6. base64 — RFC 3548: Base16, Base32, Base64 Data Encodings"
             >next</a> |</li>
        <li class="right" >
          <a href="mailbox.html" title="18.4. mailbox — Manipulate mailboxes in various formats"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v3.2.2 documentation</a> &raquo;</li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="netdata.html" >18. Internet Data Handling</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2011, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.  
    <a href="http://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Sep 04, 2011.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>

  </body>
</html>