~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-2.7.12-docs-html/library/uu.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
 
 
4
 
 
5
<html xmlns="http://www.w3.org/1999/xhtml">
 
6
  <head>
 
7
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
8
    
 
9
    <title>18.16. uu — Encode and decode uuencode files &mdash; Python 2.7.12 documentation</title>
 
10
    
 
11
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
 
12
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
13
    
 
14
    <script type="text/javascript">
 
15
      var DOCUMENTATION_OPTIONS = {
 
16
        URL_ROOT:    '../',
 
17
        VERSION:     '2.7.12',
 
18
        COLLAPSE_INDEX: false,
 
19
        FILE_SUFFIX: '.html',
 
20
        HAS_SOURCE:  true
 
21
      };
 
22
    </script>
 
23
    <script type="text/javascript" src="../_static/jquery.js"></script>
 
24
    <script type="text/javascript" src="../_static/underscore.js"></script>
 
25
    <script type="text/javascript" src="../_static/doctools.js"></script>
 
26
    <script type="text/javascript" src="../_static/sidebar.js"></script>
 
27
    <link rel="search" type="application/opensearchdescription+xml"
 
28
          title="Search within Python 2.7.12 documentation"
 
29
          href="../_static/opensearch.xml"/>
 
30
    <link rel="author" title="About these documents" href="../about.html" />
 
31
    <link rel="copyright" title="Copyright" href="../copyright.html" />
 
32
    <link rel="top" title="Python 2.7.12 documentation" href="../contents.html" />
 
33
    <link rel="up" title="18. Internet Data Handling" href="netdata.html" />
 
34
    <link rel="next" title="19. Structured Markup Processing Tools" href="markup.html" />
 
35
    <link rel="prev" title="18.15. quopri — Encode and decode MIME quoted-printable data" href="quopri.html" />
 
36
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 
37
    <script type="text/javascript" src="../_static/copybutton.js"></script>
 
38
    <script type="text/javascript" src="../_static/version_switch.js"></script>
 
39
 
 
40
    
 
41
 
 
42
  </head>
 
43
  <body role="document">  
 
44
    <div class="related" role="navigation" aria-label="related navigation">
 
45
      <h3>Navigation</h3>
 
46
      <ul>
 
47
        <li class="right" style="margin-right: 10px">
 
48
          <a href="../genindex.html" title="General Index"
 
49
             accesskey="I">index</a></li>
 
50
        <li class="right" >
 
51
          <a href="../py-modindex.html" title="Python Module Index"
 
52
             >modules</a> |</li>
 
53
        <li class="right" >
 
54
          <a href="markup.html" title="19. Structured Markup Processing Tools"
 
55
             accesskey="N">next</a> |</li>
 
56
        <li class="right" >
 
57
          <a href="quopri.html" title="18.15. quopri — Encode and decode MIME quoted-printable data"
 
58
             accesskey="P">previous</a> |</li>
 
59
        <li><img src="../_static/py.png" alt=""
 
60
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
61
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
62
        <li>
 
63
          <span class="version_switcher_placeholder">2.7.12</span>
 
64
          <a href="../index.html">Documentation</a> &raquo;
 
65
        </li>
 
66
 
 
67
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
 
68
          <li class="nav-item nav-item-2"><a href="netdata.html" accesskey="U">18. Internet Data Handling</a> &raquo;</li> 
 
69
      </ul>
 
70
    </div>    
 
71
 
 
72
    <div class="document">
 
73
      <div class="documentwrapper">
 
74
        <div class="bodywrapper">
 
75
          <div class="body" role="main">
 
76
            
 
77
  <div class="section" id="module-uu">
 
78
<span id="uu-encode-and-decode-uuencode-files"></span><h1>18.16. <a class="reference internal" href="#module-uu" title="uu: Encode and decode files in uuencode format."><code class="xref py py-mod docutils literal"><span class="pre">uu</span></code></a> &#8212; Encode and decode uuencode files<a class="headerlink" href="#module-uu" title="Permalink to this headline">¶</a></h1>
 
79
<p><strong>Source code:</strong> <a class="reference external" href="https://hg.python.org/cpython/file/2.7/Lib/uu.py">Lib/uu.py</a></p>
 
80
<hr class="docutils" />
 
81
<p>This module encodes and decodes files in uuencode format, allowing arbitrary
 
82
binary data to be transferred over ASCII-only connections. Wherever a file
 
83
argument is expected, the methods accept a file-like object.  For backwards
 
84
compatibility, a string containing a pathname is also accepted, and the
 
85
corresponding file will be opened for reading and writing; the pathname <code class="docutils literal"><span class="pre">'-'</span></code>
 
86
is understood to mean the standard input or output.  However, this interface is
 
87
deprecated; it&#8217;s better for the caller to open the file itself, and be sure
 
88
that, when required, the mode is <code class="docutils literal"><span class="pre">'rb'</span></code> or <code class="docutils literal"><span class="pre">'wb'</span></code> on Windows.</p>
 
89
<p id="index-0">This code was contributed by Lance Ellinghouse, and modified by Jack Jansen.</p>
 
90
<p>The <a class="reference internal" href="#module-uu" title="uu: Encode and decode files in uuencode format."><code class="xref py py-mod docutils literal"><span class="pre">uu</span></code></a> module defines the following functions:</p>
 
91
<dl class="function">
 
92
<dt id="uu.encode">
 
93
<code class="descclassname">uu.</code><code class="descname">encode</code><span class="sig-paren">(</span><em>in_file</em>, <em>out_file</em><span class="optional">[</span>, <em>name</em><span class="optional">[</span>, <em>mode</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#uu.encode" title="Permalink to this definition">¶</a></dt>
 
94
<dd><p>Uuencode file <em>in_file</em> into file <em>out_file</em>.  The uuencoded file will have the
 
95
header specifying <em>name</em> and <em>mode</em> as the defaults for the results of decoding
 
96
the file. The default defaults are taken from <em>in_file</em>, or <code class="docutils literal"><span class="pre">'-'</span></code> and <code class="docutils literal"><span class="pre">0666</span></code>
 
97
respectively.</p>
 
98
</dd></dl>
 
99
 
 
100
<dl class="function">
 
101
<dt id="uu.decode">
 
102
<code class="descclassname">uu.</code><code class="descname">decode</code><span class="sig-paren">(</span><em>in_file</em><span class="optional">[</span>, <em>out_file</em><span class="optional">[</span>, <em>mode</em><span class="optional">[</span>, <em>quiet</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#uu.decode" title="Permalink to this definition">¶</a></dt>
 
103
<dd><p>This call decodes uuencoded file <em>in_file</em> placing the result on file
 
104
<em>out_file</em>. If <em>out_file</em> is a pathname, <em>mode</em> is used to set the permission
 
105
bits if the file must be created. Defaults for <em>out_file</em> and <em>mode</em> are taken
 
106
from the uuencode header.  However, if the file specified in the header already
 
107
exists, a <a class="reference internal" href="#uu.Error" title="uu.Error"><code class="xref py py-exc docutils literal"><span class="pre">uu.Error</span></code></a> is raised.</p>
 
108
<p><a class="reference internal" href="#uu.decode" title="uu.decode"><code class="xref py py-func docutils literal"><span class="pre">decode()</span></code></a> may print a warning to standard error if the input was produced
 
109
by an incorrect uuencoder and Python could recover from that error.  Setting
 
110
<em>quiet</em> to a true value silences this warning.</p>
 
111
</dd></dl>
 
112
 
 
113
<dl class="exception">
 
114
<dt id="uu.Error">
 
115
<em class="property">exception </em><code class="descclassname">uu.</code><code class="descname">Error</code><a class="headerlink" href="#uu.Error" title="Permalink to this definition">¶</a></dt>
 
116
<dd><p>Subclass of <a class="reference internal" href="exceptions.html#exceptions.Exception" title="exceptions.Exception"><code class="xref py py-exc docutils literal"><span class="pre">Exception</span></code></a>, this can be raised by <a class="reference internal" href="#uu.decode" title="uu.decode"><code class="xref py py-func docutils literal"><span class="pre">uu.decode()</span></code></a> under
 
117
various situations, such as described above, but also including a badly
 
118
formatted header, or truncated input file.</p>
 
119
</dd></dl>
 
120
 
 
121
<div class="admonition seealso">
 
122
<p class="first admonition-title">See also</p>
 
123
<dl class="last docutils">
 
124
<dt>Module <a class="reference internal" href="binascii.html#module-binascii" title="binascii: Tools for converting between binary and various ASCII-encoded binary representations."><code class="xref py py-mod docutils literal"><span class="pre">binascii</span></code></a></dt>
 
125
<dd>Support module containing ASCII-to-binary and binary-to-ASCII conversions.</dd>
 
126
</dl>
 
127
</div>
 
128
</div>
 
129
 
 
130
 
 
131
          </div>
 
132
        </div>
 
133
      </div>
 
134
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
 
135
        <div class="sphinxsidebarwrapper">
 
136
  <h4>Previous topic</h4>
 
137
  <p class="topless"><a href="quopri.html"
 
138
                        title="previous chapter">18.15. <code class="docutils literal"><span class="pre">quopri</span></code> &#8212; Encode and decode MIME quoted-printable data</a></p>
 
139
  <h4>Next topic</h4>
 
140
  <p class="topless"><a href="markup.html"
 
141
                        title="next chapter">19. Structured Markup Processing Tools</a></p>
 
142
<h3>This Page</h3>
 
143
<ul class="this-page-menu">
 
144
  <li><a href="../bugs.html">Report a Bug</a></li>
 
145
  <li><a href="../_sources/library/uu.txt"
 
146
         rel="nofollow">Show Source</a></li>
 
147
</ul>
 
148
 
 
149
<div id="searchbox" style="display: none" role="search">
 
150
  <h3>Quick search</h3>
 
151
    <form class="search" action="../search.html" method="get">
 
152
      <input type="text" name="q" />
 
153
      <input type="submit" value="Go" />
 
154
      <input type="hidden" name="check_keywords" value="yes" />
 
155
      <input type="hidden" name="area" value="default" />
 
156
    </form>
 
157
    <p class="searchtip" style="font-size: 90%">
 
158
    Enter search terms or a module, class or function name.
 
159
    </p>
 
160
</div>
 
161
<script type="text/javascript">$('#searchbox').show(0);</script>
 
162
        </div>
 
163
      </div>
 
164
      <div class="clearer"></div>
 
165
    </div>  
 
166
    <div class="related" role="navigation" aria-label="related navigation">
 
167
      <h3>Navigation</h3>
 
168
      <ul>
 
169
        <li class="right" style="margin-right: 10px">
 
170
          <a href="../genindex.html" title="General Index"
 
171
             >index</a></li>
 
172
        <li class="right" >
 
173
          <a href="../py-modindex.html" title="Python Module Index"
 
174
             >modules</a> |</li>
 
175
        <li class="right" >
 
176
          <a href="markup.html" title="19. Structured Markup Processing Tools"
 
177
             >next</a> |</li>
 
178
        <li class="right" >
 
179
          <a href="quopri.html" title="18.15. quopri — Encode and decode MIME quoted-printable data"
 
180
             >previous</a> |</li>
 
181
        <li><img src="../_static/py.png" alt=""
 
182
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
183
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
184
        <li>
 
185
          <span class="version_switcher_placeholder">2.7.12</span>
 
186
          <a href="../index.html">Documentation</a> &raquo;
 
187
        </li>
 
188
 
 
189
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
 
190
          <li class="nav-item nav-item-2"><a href="netdata.html" >18. Internet Data Handling</a> &raquo;</li> 
 
191
      </ul>
 
192
    </div>  
 
193
    <div class="footer">
 
194
    &copy; <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
 
195
    <br />
 
196
    The Python Software Foundation is a non-profit corporation.
 
197
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
 
198
    <br />
 
199
    Last updated on Sep 20, 2016.
 
200
    <a href="../bugs.html">Found a bug</a>?
 
201
    <br />
 
202
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
 
203
    </div>
 
204
 
 
205
  </body>
 
206
</html>
 
 
b'\\ No newline at end of file'