home *** CD-ROM | disk | FTP | other *** search
- <TITLE>uu -- Python library reference</TITLE>
- Next: <A HREF="../b/binascii" TYPE="Next">binascii</A>
- Prev: <A HREF="../b/binhex" TYPE="Prev">binhex</A>
- Up: <A HREF="../i/internet_and_www" TYPE="Up">Internet and WWW</A>
- Top: <A HREF="../t/top" TYPE="Top">Top</A>
- <H1>10.14. Standard module <CODE>uu</CODE></H1>
- This module encodes and decodes files in uuencode format, allowing
- arbitrary binary data to be transferred over ascii-only connections.
- Whereever a file argument is expected, the methods accept either a
- pathname (<CODE>'-'</CODE> for stdin/stdout) or a file-like object.
- <P>
- Normally you would pass filenames, but there is one case where you
- have to open the file yourself: if you are on a non-unix platform and
- your binary file is actually a textfile that you want encoded
- unix-compatible you will have to open the file yourself as a textfile,
- so newline conversion is performed.
- <P>
- This code was contributed by Lance Ellinghouse, and modified by Jack
- Jansen.
- <P>
- The <CODE>uu</CODE> module defines the following functions:
- <P>
- <DL><DT><B>encode</B> (<VAR>in_file</VAR>, <VAR>out_file</VAR>[, <VAR>name</VAR>, <VAR>mode</VAR>]) -- function of module uu<DD>
- Uuencode file <VAR>in_file</VAR> into file <VAR>out_file</VAR>. The uuencoded
- file will have the header specifying <VAR>name</VAR> and <VAR>mode</VAR> as the
- defaults for the results of decoding the file. The default defaults
- are taken from <VAR>in_file</VAR>, or <CODE>'-'</CODE> and <CODE>0666</CODE>
- respectively.
- </DL>
- <DL><DT><B>decode</B> (<VAR>in_file</VAR>[, <VAR>out_file</VAR>, <VAR>mode</VAR>]) -- function of module uu<DD>
- This call decodes uuencoded file <VAR>in_file</VAR> placing the result on
- file <VAR>out_file</VAR>. If <VAR>out_file</VAR> is a pathname the <VAR>mode</VAR> is
- also set. Defaults for <VAR>out_file</VAR> and <VAR>mode</VAR> are taken from
- the uuencode header.
- </DL>
-