| 
									
										
										
										
											1998-01-13 16:53:23 +00:00
										 |  |  | \documentclass[twoside,openright]{report} | 
					
						
							| 
									
										
										
										
											1998-01-09 05:36:43 +00:00
										 |  |  | \usepackage{myformat} | 
					
						
							| 
									
										
										
										
											1991-02-19 12:53:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-02-28 17:14:32 +00:00
										 |  |  | % NOTE: this file controls which chapters/sections of the library
 | 
					
						
							|  |  |  | % manual are actually printed.  It is easy to customize your manual
 | 
					
						
							|  |  |  | % by commenting out sections that you're not interested in.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \title{Python Library Reference} | 
					
						
							| 
									
										
										
										
											1991-01-22 11:45:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1994-10-06 10:29:26 +00:00
										 |  |  | \input{boilerplate} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | \makeindex			% tell \index to actually write the .idx file
 | 
					
						
							| 
									
										
										
										
											1993-11-23 16:28:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1992-01-07 16:40:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1991-01-22 11:45:29 +00:00
										 |  |  | \begin{document} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1991-01-22 11:45:29 +00:00
										 |  |  | \maketitle | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1994-10-06 10:29:26 +00:00
										 |  |  | \input{copyright} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1991-01-22 11:45:29 +00:00
										 |  |  | \begin{abstract} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \noindent | 
					
						
							| 
									
										
										
										
											1995-03-30 16:01:33 +00:00
										 |  |  | Python is an extensible, interpreted, object-oriented programming | 
					
						
							|  |  |  | language.  It supports a wide range of applications, from simple text | 
					
						
							|  |  |  | processing scripts to interactive WWW browsers. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-12-18 15:56:05 +00:00
										 |  |  | While the \emph{Python Reference Manual} describes the exact syntax and | 
					
						
							| 
									
										
										
										
											1995-03-30 16:01:33 +00:00
										 |  |  | semantics of the language, it does not describe the standard library | 
					
						
							|  |  |  | that is distributed with the language, and which greatly enhances its | 
					
						
							|  |  |  | immediate usability.  This library contains built-in modules (written | 
					
						
							|  |  |  | in C) that provide access to system functionality such as file I/O | 
					
						
							|  |  |  | that would otherwise be inaccessible to Python programmers, as well as | 
					
						
							|  |  |  | modules written in Python that provide standardized solutions for many | 
					
						
							|  |  |  | problems that occur in everyday programming.  Some of these modules | 
					
						
							|  |  |  | are explicitly designed to encourage and enhance the portability of | 
					
						
							|  |  |  | Python programs. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This library reference manual documents Python's standard library, as | 
					
						
							|  |  |  | well as many optional library modules (which may or may not be | 
					
						
							|  |  |  | available, depending on whether the underlying platform supports them | 
					
						
							|  |  |  | and on the configuration choices made at compile time).  It also | 
					
						
							|  |  |  | documents the standard types of the language and its built-in | 
					
						
							|  |  |  | functions and exceptions, many of which are not or incompletely | 
					
						
							|  |  |  | documented in the Reference Manual. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This manual assumes basic knowledge about the Python language.  For an | 
					
						
							| 
									
										
										
										
											1997-12-18 15:56:05 +00:00
										 |  |  | informal introduction to Python, see the \emph{Python Tutorial}; the | 
					
						
							| 
									
										
										
										
											1998-01-16 16:34:34 +00:00
										 |  |  | \emph{Python Reference Manual} remains the highest authority on | 
					
						
							|  |  |  | syntactic and semantic questions.  Finally, the manual entitled | 
					
						
							|  |  |  | \emph{Extending and Embedding the Python Interpreter} describes how to | 
					
						
							|  |  |  | add new extensions to Python and how to embed it in other applications. | 
					
						
							| 
									
										
										
										
											1991-01-22 11:45:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | \end{abstract} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-01-13 22:25:02 +00:00
										 |  |  | \tableofcontents | 
					
						
							| 
									
										
										
										
											1991-01-22 11:45:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 				% Chapter title:
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \input{libintro}		% Introduction
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \input{libobjs}			% Built-in Types, Exceptions and Functions
 | 
					
						
							|  |  |  | \input{libtypes} | 
					
						
							|  |  |  | \input{libexcs} | 
					
						
							|  |  |  | \input{libfuncs} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libpython}		% Python Services
 | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libsys} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libtypes2}		% types is already taken :-(
 | 
					
						
							| 
									
										
										
										
											1997-08-30 20:02:25 +00:00
										 |  |  | \input{libuserdict} | 
					
						
							| 
									
										
										
										
											1996-12-06 21:22:41 +00:00
										 |  |  | \input{liboperator} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libtraceback} | 
					
						
							|  |  |  | \input{libpickle} | 
					
						
							| 
									
										
										
										
											1998-01-21 04:58:39 +00:00
										 |  |  | \input{libcopyreg} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libshelve} | 
					
						
							|  |  |  | \input{libcopy} | 
					
						
							|  |  |  | \input{libmarshal} | 
					
						
							| 
									
										
										
										
											1995-01-04 19:17:34 +00:00
										 |  |  | \input{libimp} | 
					
						
							| 
									
										
										
										
											1997-07-17 16:27:42 +00:00
										 |  |  | \input{libni} | 
					
						
							| 
									
										
										
										
											1995-10-11 17:32:29 +00:00
										 |  |  | \input{libparser} | 
					
						
							| 
									
										
										
										
											1998-02-18 15:59:13 +00:00
										 |  |  | \input{libsymbol} | 
					
						
							|  |  |  | \input{libtoken} | 
					
						
							| 
									
										
										
										
											1997-10-06 21:40:48 +00:00
										 |  |  | \input{libkeyword} | 
					
						
							| 
									
										
										
										
											1997-07-18 21:08:07 +00:00
										 |  |  | \input{libcode} | 
					
						
							| 
									
										
										
										
											1997-10-06 21:26:03 +00:00
										 |  |  | \input{libpprint} | 
					
						
							| 
									
										
										
										
											1997-11-18 15:11:47 +00:00
										 |  |  | \input{libdis} | 
					
						
							| 
									
										
										
										
											1997-04-03 22:41:49 +00:00
										 |  |  | \input{libsite} | 
					
						
							| 
									
										
										
										
											1997-08-30 20:02:25 +00:00
										 |  |  | \input{libuser} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libbltin}		% really __builtin__
 | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libmain}			% really __main__
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | \input{libstrings}		% String Services
 | 
					
						
							|  |  |  | \input{libstring} | 
					
						
							| 
									
										
										
										
											1997-12-29 20:01:55 +00:00
										 |  |  | \input{libre} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libregex} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libregsub} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libstruct} | 
					
						
							| 
									
										
										
										
											1997-03-03 16:01:21 +00:00
										 |  |  | \input{libstrio} | 
					
						
							| 
									
										
										
										
											1996-12-12 17:02:21 +00:00
										 |  |  | \input{libsoundex} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libmisc}			% Miscellaneous Services
 | 
					
						
							|  |  |  | \input{libmath} | 
					
						
							| 
									
										
										
										
											1997-07-17 16:15:18 +00:00
										 |  |  | \input{libcmath} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libwhrandom} | 
					
						
							| 
									
										
										
										
											1997-04-03 22:41:49 +00:00
										 |  |  | \input{librandom} | 
					
						
							|  |  |  | \input{librand} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libarray} | 
					
						
							| 
									
										
										
										
											1995-03-02 12:38:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{liballos}		% Generic Operating System Services
 | 
					
						
							|  |  |  | \input{libos} | 
					
						
							|  |  |  | \input{libtime} | 
					
						
							|  |  |  | \input{libgetopt} | 
					
						
							|  |  |  | \input{libtempfile} | 
					
						
							| 
									
										
										
										
											1996-07-30 18:20:01 +00:00
										 |  |  | \input{liberrno} | 
					
						
							| 
									
										
										
										
											1997-03-25 22:09:18 +00:00
										 |  |  | \input{libglob} | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | \input{libfnmatch} | 
					
						
							| 
									
										
										
										
											1997-11-20 21:04:27 +00:00
										 |  |  | \input{liblocale} | 
					
						
							| 
									
										
										
										
											1995-03-02 12:38:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libsomeos}		% Optional Operating System Services
 | 
					
						
							|  |  |  | \input{libsignal} | 
					
						
							|  |  |  | \input{libsocket} | 
					
						
							|  |  |  | \input{libselect} | 
					
						
							|  |  |  | \input{libthread} | 
					
						
							| 
									
										
										
										
											1997-11-20 19:54:16 +00:00
										 |  |  | \input{libqueue} | 
					
						
							| 
									
										
										
										
											1997-04-03 22:41:49 +00:00
										 |  |  | \input{libanydbm} | 
					
						
							|  |  |  | \input{libwhichdb} | 
					
						
							| 
									
										
										
										
											1997-04-30 19:40:10 +00:00
										 |  |  | \input{libzlib} | 
					
						
							| 
									
										
										
										
											1997-07-17 16:27:42 +00:00
										 |  |  | \input{libgzip} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libunix}			% UNIX Specific Services
 | 
					
						
							|  |  |  | \input{libposix} | 
					
						
							|  |  |  | \input{libppath}		% == posixpath
 | 
					
						
							|  |  |  | \input{libpwd} | 
					
						
							|  |  |  | \input{libgrp} | 
					
						
							| 
									
										
										
										
											1996-04-10 16:18:20 +00:00
										 |  |  | \input{libcrypt} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libdbm} | 
					
						
							| 
									
										
										
										
											1994-08-08 08:03:24 +00:00
										 |  |  | \input{libgdbm} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libtermios} | 
					
						
							|  |  |  | \input{libfcntl} | 
					
						
							| 
									
										
										
										
											1995-01-04 19:17:34 +00:00
										 |  |  | \input{libposixfile} | 
					
						
							| 
									
										
										
										
											1996-12-18 18:37:05 +00:00
										 |  |  | \input{libresource} | 
					
						
							| 
									
										
										
										
											1995-10-09 20:49:57 +00:00
										 |  |  | \input{libsyslog} | 
					
						
							| 
									
										
										
										
											1996-12-31 02:24:54 +00:00
										 |  |  | \input{libstat} | 
					
						
							| 
									
										
										
										
											1997-06-12 16:05:46 +00:00
										 |  |  | \input{libcommands} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libpdb}			% The Python Debugger
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \input{libprofile}		% The Python Profiler
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \input{libwww}			% Internet and WWW Services
 | 
					
						
							| 
									
										
										
										
											1995-02-27 17:53:25 +00:00
										 |  |  | \input{libcgi} | 
					
						
							| 
									
										
										
										
											1995-03-22 15:48:46 +00:00
										 |  |  | \input{liburllib} | 
					
						
							|  |  |  | \input{libhttplib} | 
					
						
							| 
									
										
										
										
											1995-02-16 16:28:22 +00:00
										 |  |  | \input{libftplib} | 
					
						
							|  |  |  | \input{libgopherlib} | 
					
						
							|  |  |  | \input{libnntplib} | 
					
						
							|  |  |  | \input{liburlparse} | 
					
						
							| 
									
										
										
										
											1995-03-22 15:48:46 +00:00
										 |  |  | \input{libsgmllib} | 
					
						
							| 
									
										
										
										
											1996-10-09 14:36:54 +00:00
										 |  |  | \input{libhtmllib} | 
					
						
							| 
									
										
										
										
											1997-11-18 15:11:47 +00:00
										 |  |  | \input{libxmllib} | 
					
						
							| 
									
										
										
										
											1996-10-08 21:54:41 +00:00
										 |  |  | \input{libformatter} | 
					
						
							| 
									
										
										
										
											1995-03-22 15:48:46 +00:00
										 |  |  | \input{librfc822} | 
					
						
							|  |  |  | \input{libmimetools} | 
					
						
							| 
									
										
										
										
											1998-02-19 18:29:18 +00:00
										 |  |  | \input{libbinhex} | 
					
						
							|  |  |  | \input{libuu} | 
					
						
							| 
									
										
										
										
											1995-08-29 11:30:24 +00:00
										 |  |  | \input{libbinascii} | 
					
						
							| 
									
										
										
										
											1996-08-19 22:58:03 +00:00
										 |  |  | \input{libxdrlib} | 
					
						
							| 
									
										
										
										
											1997-03-25 22:09:18 +00:00
										 |  |  | \input{libmailcap} | 
					
						
							| 
									
										
										
										
											1997-04-27 21:25:52 +00:00
										 |  |  | \input{libbase64} | 
					
						
							|  |  |  | \input{libquopri} | 
					
						
							| 
									
										
										
										
											1997-05-19 19:55:16 +00:00
										 |  |  | \input{libsocksvr} | 
					
						
							| 
									
										
										
										
											1997-06-02 17:35:51 +00:00
										 |  |  | \input{libmailbox} | 
					
						
							| 
									
										
										
										
											1997-07-30 22:05:07 +00:00
										 |  |  | \input{libmimify} | 
					
						
							| 
									
										
										
										
											1997-12-29 20:01:55 +00:00
										 |  |  | \input{libbasehttp} | 
					
						
							| 
									
										
										
										
											1995-02-16 16:28:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-10-22 01:11:53 +00:00
										 |  |  | \input{librestricted} | 
					
						
							|  |  |  | \input{librexec} | 
					
						
							|  |  |  | \input{libbastion} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libmm}			% Multimedia Services
 | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libaudioop} | 
					
						
							|  |  |  | \input{libimageop} | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libaifc} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libjpeg} | 
					
						
							|  |  |  | \input{librgbimg} | 
					
						
							| 
									
										
										
										
											1996-08-19 22:58:03 +00:00
										 |  |  | \input{libimghdr} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-03-28 13:35:14 +00:00
										 |  |  | \input{libcrypto}		% Cryptographic Services
 | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libmd5} | 
					
						
							|  |  |  | \input{libmpz} | 
					
						
							|  |  |  | \input{librotor} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %\input{libamoeba}		% AMOEBA ONLY
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-02-28 17:14:32 +00:00
										 |  |  | \input{libmac}			% MACINTOSH ONLY
 | 
					
						
							| 
									
										
										
										
											1995-03-01 15:38:16 +00:00
										 |  |  | \input{libctb} | 
					
						
							|  |  |  | \input{libmacconsole} | 
					
						
							| 
									
										
										
										
											1995-03-07 10:12:11 +00:00
										 |  |  | \input{libmacdnr} | 
					
						
							| 
									
										
										
										
											1995-03-01 15:38:16 +00:00
										 |  |  | \input{libmacfs} | 
					
						
							| 
									
										
										
										
											1997-08-18 15:14:26 +00:00
										 |  |  | \input{libmacic} | 
					
						
							| 
									
										
										
										
											1995-08-14 13:40:05 +00:00
										 |  |  | \input{libmacos} | 
					
						
							| 
									
										
										
										
											1995-10-10 14:43:20 +00:00
										 |  |  | \input{libmacostools} | 
					
						
							| 
									
										
										
										
											1995-03-01 15:38:16 +00:00
										 |  |  | \input{libmactcp} | 
					
						
							|  |  |  | \input{libmacspeech} | 
					
						
							| 
									
										
										
										
											1995-10-10 14:43:20 +00:00
										 |  |  | \input{libmacui} | 
					
						
							| 
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 |  |  | \input{libframework} | 
					
						
							|  |  |  | \input{libminiae} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-06-02 17:35:51 +00:00
										 |  |  | %\input{libstdwin}		% STDWIN ONLY
 | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | \input{libsgi}			% SGI IRIX ONLY
 | 
					
						
							|  |  |  | \input{libal} | 
					
						
							| 
									
										
										
										
											1995-03-28 11:56:52 +00:00
										 |  |  | \input{libcd} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{libfl} | 
					
						
							|  |  |  | \input{libfm} | 
					
						
							|  |  |  | \input{libgl} | 
					
						
							|  |  |  | \input{libimgfile} | 
					
						
							|  |  |  | %\input{libpanel}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \input{libsun}			% SUNOS ONLY
 | 
					
						
							| 
									
										
										
										
											1998-02-19 18:59:48 +00:00
										 |  |  | \input{libsunaudio} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-03-14 04:12:52 +00:00
										 |  |  | \input{libundoc} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-01-02 02:59:09 +00:00
										 |  |  | \renewcommand{\indexname}{Module Index} | 
					
						
							|  |  |  | \input{modules.ind}		% Module Index
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \renewcommand{\indexname}{Index} | 
					
						
							| 
									
										
										
										
											1994-08-01 12:22:53 +00:00
										 |  |  | \input{lib.ind}			% Index
 | 
					
						
							| 
									
										
										
										
											1991-01-22 11:45:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | \end{document} |