blob: 9e4dcb5ef0c94ce28d9fa783e1fd9fe8db85aef3 [file] [log] [blame]
Fred Drake6659c301998-03-03 22:02:19 +00001\documentclass{manual}
Guido van Rossum19f1b821991-11-12 15:41:57 +00002
Guido van Rossum86751151995-02-28 17:14:32 +00003% NOTE: this file controls which chapters/sections of the library
4% manual are actually printed. It is easy to customize your manual
5% by commenting out sections that you're not interested in.
6
Guido van Rossum6938f061994-08-01 12:22:53 +00007\title{Python Library Reference}
Guido van Rossum515834a1991-01-22 11:45:29 +00008
Guido van Rossum16cd7f91994-10-06 10:29:26 +00009\input{boilerplate}
Guido van Rossum83eb9621993-11-23 16:28:45 +000010
Fred Drake7c30de62001-02-22 21:25:20 +000011\makeindex % tell \index to actually write the
12 % .idx file
13\makemodindex % ... and the module index as well.
Guido van Rossum6938f061994-08-01 12:22:53 +000014
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +000015
Guido van Rossum515834a1991-01-22 11:45:29 +000016\begin{document}
Guido van Rossum6938f061994-08-01 12:22:53 +000017
Guido van Rossum515834a1991-01-22 11:45:29 +000018\maketitle
19
Fred Drake9f86b661998-07-28 21:55:19 +000020\ifhtml
21\chapter*{Front Matter\label{front}}
22\fi
23
Guido van Rossum16cd7f91994-10-06 10:29:26 +000024\input{copyright}
25
Guido van Rossum515834a1991-01-22 11:45:29 +000026\begin{abstract}
27
28\noindent
Guido van Rossum2ddd9781995-03-30 16:01:33 +000029Python is an extensible, interpreted, object-oriented programming
30language. It supports a wide range of applications, from simple text
Fred Drake8ee679f2001-07-14 02:50:55 +000031processing scripts to interactive Web browsers.
Guido van Rossum2ddd9781995-03-30 16:01:33 +000032
Fred Drake37f15741999-11-10 16:21:37 +000033While the \citetitle[../ref/ref.html]{Python Reference Manual}
34describes the exact syntax and semantics of the language, it does not
35describe the standard library that is distributed with the language,
36and which greatly enhances its immediate usability. This library
37contains built-in modules (written in C) that provide access to system
38functionality such as file I/O that would otherwise be inaccessible to
39Python programmers, as well as modules written in Python that provide
40standardized solutions for many problems that occur in everyday
41programming. Some of these modules are explicitly designed to
42encourage and enhance the portability of Python programs.
Guido van Rossum2ddd9781995-03-30 16:01:33 +000043
44This library reference manual documents Python's standard library, as
45well as many optional library modules (which may or may not be
46available, depending on whether the underlying platform supports them
47and on the configuration choices made at compile time). It also
48documents the standard types of the language and its built-in
49functions and exceptions, many of which are not or incompletely
50documented in the Reference Manual.
51
52This manual assumes basic knowledge about the Python language. For an
Fred Drake37f15741999-11-10 16:21:37 +000053informal introduction to Python, see the
54\citetitle[../tut/tut.html]{Python Tutorial}; the
55\citetitle[../ref/ref.html]{Python Reference Manual} remains the
56highest authority on syntactic and semantic questions. Finally, the
57manual entitled \citetitle[../ext/ext.html]{Extending and Embedding
58the Python Interpreter} describes how to add new extensions to Python
59and how to embed it in other applications.
Guido van Rossum515834a1991-01-22 11:45:29 +000060
61\end{abstract}
62
Fred Drake4d4f9e71998-01-13 22:25:02 +000063\tableofcontents
Guido van Rossum515834a1991-01-22 11:45:29 +000064
Fred Drake7c30de62001-02-22 21:25:20 +000065 % Chapter title:
Guido van Rossum6938f061994-08-01 12:22:53 +000066
Fred Drake7c30de62001-02-22 21:25:20 +000067\input{libintro} % Introduction
Guido van Rossum6938f061994-08-01 12:22:53 +000068
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +000069
70% =============
71% BUILT-INs
72% =============
73
Fred Drake7c30de62001-02-22 21:25:20 +000074\input{libobjs} % Built-in Types, Exceptions and Functions
Fred Drakeb4ea9d02001-10-30 06:22:02 +000075\input{libfuncs}
Fred Drake64e3b431998-07-24 13:56:11 +000076\input{libstdtypes}
Guido van Rossum6938f061994-08-01 12:22:53 +000077\input{libexcs}
Skip Montanaro1f041e72003-01-01 20:34:00 +000078\input{libconsts}
Guido van Rossum6938f061994-08-01 12:22:53 +000079
Guido van Rossumecde7811995-03-28 13:35:14 +000080
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +000081
82% =============
83% BASIC/GENERAL-PURPOSE OBJECTS
84% =============
85
86% Strings
Fred Drake7c30de62001-02-22 21:25:20 +000087\input{libstrings} % String Services
Guido van Rossumecde7811995-03-28 13:35:14 +000088\input{libstring}
Guido van Rossum9cb64801997-12-29 20:01:55 +000089\input{libre}
Skip Montanaro05885812005-01-16 20:48:27 +000090\input{libreconvert}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +000091\input{libstruct} % XXX also/better in File Formats?
Fred Drake15bc4042001-02-19 16:32:40 +000092\input{libdifflib}
Fred Drake64e3b431998-07-24 13:56:11 +000093\input{libstringio}
Greg Wardae64f3ad2002-06-29 02:38:50 +000094\input{libtextwrap}
Fred Drake98f8a3d2000-04-06 14:25:28 +000095\input{libcodecs}
Fred Drakefb79ffa2000-06-13 20:51:29 +000096\input{libunicodedata}
Martin v. Löwis2548c732003-04-18 10:39:54 +000097\input{libstringprep}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +000098\input{libfpformat}
Guido van Rossumecde7811995-03-28 13:35:14 +000099
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000100
101\input{datatypes} % Data types and structures
102\input{libdatetime}
103\input{libcalendar}
Raymond Hettingerdd256d92004-01-29 07:35:45 +0000104\input{libcollections}
Guido van Rossum97512162002-08-02 18:03:24 +0000105\input{libheapq}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000106\input{libbisect}
Guido van Rossumecde7811995-03-28 13:35:14 +0000107\input{libarray}
Raymond Hettinger584cb192002-08-23 15:18:38 +0000108\input{libsets}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000109\input{libsched}
110\input{libmutex}
111\input{libqueue}
112\input{libweakref}
113\input{libuserdict}
114
115% General object services
116% XXX intro
117\input{libtypes}
118\input{libnew}
119\input{libcopy}
120\input{libpprint}
121\input{librepr}
122
123
124\input{numeric} % Numeric/Mathematical modules
125\input{libmath}
126\input{libcmath}
127\input{libdecimal}
128\input{librandom}
129
130% Functions, Functional, Generators and Iterators
131% XXX intro functional
Raymond Hettinger96ef8112003-02-01 00:10:11 +0000132\input{libitertools}
Raymond Hettinger9c323f82005-02-28 19:39:44 +0000133\input{libfunctional}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000134\input{liboperator} % from runtime - better with itertools and functional
Guido van Rossumecde7811995-03-28 13:35:14 +0000135
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000136
137% =============
138% DATA FORMATS
139% =============
140
141% Big move - include all the markup and internet formats here
142
143% MIME & email stuff
144\input{netdata} % Internet Data Handling
145\input{email}
146\input{libmailcap}
147\input{libmailbox}
148\input{libmhlib}
149\input{libmimetools}
150\input{libmimetypes}
151\input{libmimewriter}
152\input{libmimify}
153\input{libmultifile}
154\input{librfc822}
155
156% encoding stuff
157\input{libbase64}
158\input{libbinascii}
159\input{libbinhex}
160\input{libquopri}
161\input{libuu}
162
163\input{markup} % Structured Markup Processing Tools
164\input{libhtmlparser}
165\input{libsgmllib}
166\input{libhtmllib}
167\input{libpyexpat}
168\input{xmldom}
169\input{xmldomminidom}
170\input{xmldompulldom}
171\input{xmlsax}
172\input{xmlsaxhandler}
173\input{xmlsaxutils}
174\input{xmlsaxreader}
175% \input{libxmllib}
176
177\input{fileformats} % Miscellaneous file formats
178\input{libcsv}
179\input{libcfgparser}
180\input{librobotparser}
181\input{libnetrc}
182\input{libxdrlib}
183
184\input{libcrypto} % Cryptographic Services
185\input{libhashlib}
186\input{libhmac}
187\input{libmd5}
188\input{libsha}
189
190% =============
191% FILE & DATABASE STORAGE
192% =============
193
194\input{filesys} % File/directory support
Fred Drake7c30de62001-02-22 21:25:20 +0000195\input{libposixpath} % os.path
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000196\input{libfileinput}
Fred Drake5254a6d1999-04-22 15:01:44 +0000197\input{libstat}
Fred Drake4755e7d1999-06-21 18:25:49 +0000198\input{libstatvfs}
Fred Drakeadf2dbf1999-10-29 17:24:12 +0000199\input{libfilecmp}
Guido van Rossumdc46c7f1995-03-01 15:38:16 +0000200\input{libtempfile}
Guido van Rossumb6a80261997-03-25 22:09:18 +0000201\input{libglob}
Guido van Rossume76b7a81997-04-27 21:25:52 +0000202\input{libfnmatch}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000203\input{liblinecache}
Fred Drake449e18f1998-12-28 20:16:58 +0000204\input{libshutil}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000205\input{libdircache}
Guido van Rossumecde7811995-03-28 13:35:14 +0000206
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000207
208\input{archiving} % Data compression and archiving
Guido van Rossumdfb41201997-04-30 19:40:10 +0000209\input{libzlib}
Guido van Rossum0fcbe8d1997-07-17 16:27:42 +0000210\input{libgzip}
Gustavo Niemeyerf8ca8362002-11-05 16:50:05 +0000211\input{libbz2}
Fred Drake3c9f9362000-03-31 17:51:10 +0000212\input{libzipfile}
Neal Norwitz051314f2003-01-07 22:36:04 +0000213\input{libtarfile}
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000214
215
216\input{persistence} % Persistent storage
217\input{libpickle}
218\input{libcopyreg} % really copy_reg % from runtime...
219\input{libshelve}
220\input{libmarshal}
221\input{libanydbm}
222\input{libwhichdb}
223\input{libdbm}
224\input{libgdbm}
225\input{libdbhash}
226\input{libbsddb}
227\input{libdumbdbm}
228
229
230% =============
231% OS
232% =============
233
234
235\input{liballos} % Generic Operating System Services
236\input{libos}
237\input{libtime}
238\input{liboptparse}
239\input{libgetopt}
240\input{liblogging}
241\input{libgetpass}
242\input{libcurses}
243\input{libascii} % curses.ascii
244\input{libcursespanel}
245\input{libplatform}
246\input{liberrno}
247
248\input{libsomeos} % Optional Operating System Services
249\input{libselect}
250\input{libthread}
251\input{libthreading}
252\input{libdummythread}
253\input{libdummythreading}
254\input{libmmap}
Fred Drake14ea85f2000-07-06 04:47:25 +0000255\input{libreadline}
Fred Drake4755e7d1999-06-21 18:25:49 +0000256\input{librlcompleter}
Guido van Rossumecde7811995-03-28 13:35:14 +0000257
Fred Drake7c30de62001-02-22 21:25:20 +0000258\input{libunix} % UNIX Specific Services
Guido van Rossumecde7811995-03-28 13:35:14 +0000259\input{libposix}
Guido van Rossumecde7811995-03-28 13:35:14 +0000260\input{libpwd}
Martin v. Löwisc3001752005-01-23 09:27:24 +0000261\input{libspwd}
Guido van Rossumecde7811995-03-28 13:35:14 +0000262\input{libgrp}
Guido van Rossum5c6e3731996-04-10 16:18:20 +0000263\input{libcrypt}
Fred Drake44a7a7c1999-07-01 20:39:59 +0000264\input{libdl}
Guido van Rossumecde7811995-03-28 13:35:14 +0000265\input{libtermios}
Fred Drake1b2dc901999-06-23 17:29:02 +0000266\input{libtty}
Fred Drakeabc64b71999-06-29 18:12:22 +0000267\input{libpty}
Guido van Rossumecde7811995-03-28 13:35:14 +0000268\input{libfcntl}
Fred Drake4755e7d1999-06-21 18:25:49 +0000269\input{libpipes}
Guido van Rossumecde7811995-03-28 13:35:14 +0000270\input{libposixfile}
Guido van Rossum3c7b2dc1996-12-18 18:37:05 +0000271\input{libresource}
Fred Drakee4d78181999-06-27 15:02:37 +0000272\input{libnis}
Guido van Rossumfbe34fa1995-10-09 20:49:57 +0000273\input{libsyslog}
Fred Drake4fd12921997-06-12 16:05:46 +0000274\input{libcommands}
Guido van Rossumdf804f81995-03-02 12:38:39 +0000275
Guido van Rossumdf804f81995-03-02 12:38:39 +0000276
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000277% =============
278% NETWORK & COMMUNICATIONS
279% =============
280
281\input{ipc} % Interprocess communication/networking
282\input{libsubprocess}
283\input{libsocket}
284\input{libsignal}
285\input{libpopen2}
286\input{libasyncore}
287\input{libasynchat}
Guido van Rossum6938f061994-08-01 12:22:53 +0000288
Fred Drake7c30de62001-02-22 21:25:20 +0000289\input{internet} % Internet Protocols
Fred Drakee4dbb862000-07-07 03:36:12 +0000290\input{libwebbrowser}
Guido van Rossuma12ef941995-02-27 17:53:25 +0000291\input{libcgi}
Fred Draked2a557e2001-12-04 22:48:17 +0000292\input{libcgitb}
Guido van Rossumcca8d2b1995-03-22 15:48:46 +0000293\input{liburllib}
Fred Drake7606e4d2001-03-01 19:54:29 +0000294\input{liburllib2}
Guido van Rossumcca8d2b1995-03-22 15:48:46 +0000295\input{libhttplib}
Guido van Rossum817a8421995-02-16 16:28:22 +0000296\input{libftplib}
297\input{libgopherlib}
Fred Drakea4684041998-04-24 20:49:02 +0000298\input{libpoplib}
Fred Drake1e0f8bf1998-04-11 04:27:07 +0000299\input{libimaplib}
Guido van Rossum817a8421995-02-16 16:28:22 +0000300\input{libnntplib}
Guido van Rossum8668e8e1998-06-28 17:55:53 +0000301\input{libsmtplib}
Fred Drake2363e8f2004-07-11 16:25:25 +0000302\input{libsmtpd}
Fred Drake658cef01999-03-15 15:44:18 +0000303\input{libtelnetlib}
Guido van Rossum817a8421995-02-16 16:28:22 +0000304\input{liburlparse}
Fred Drakef44c4851998-08-07 15:58:31 +0000305\input{libsocksvr}
306\input{libbasehttp}
Fred Drakec46864e1999-06-14 19:49:50 +0000307\input{libsimplehttp}
308\input{libcgihttp}
Martin v. Löwis2a6ba902004-05-31 18:22:40 +0000309\input{libcookielib}
Fred Drake15446d32000-08-19 16:55:31 +0000310\input{libcookie}
Fred Drake7988e022001-09-28 22:03:40 +0000311\input{libxmlrpclib}
312\input{libsimplexmlrpc}
Martin v. Löwis281b2c62003-04-18 21:04:39 +0000313\input{libdocxmlrpc}
Fred Drakef44c4851998-08-07 15:58:31 +0000314
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000315% =============
316% MULTIMEDIA
317% =============
Fred Drakeb5316182000-07-05 02:24:39 +0000318
Fred Drake7c30de62001-02-22 21:25:20 +0000319\input{libmm} % Multimedia Services
Guido van Rossum6938f061994-08-01 12:22:53 +0000320\input{libaudioop}
321\input{libimageop}
Guido van Rossumecde7811995-03-28 13:35:14 +0000322\input{libaifc}
Fred Drakeaf81a501999-06-23 13:34:22 +0000323\input{libsunau}
Fred Drake26da2841999-06-17 15:12:16 +0000324\input{libwave}
Fred Drake707f8e61999-06-22 18:50:06 +0000325\input{libchunk}
Fred Drake4ae52691999-04-19 21:21:28 +0000326\input{libcolorsys}
Guido van Rossum6938f061994-08-01 12:22:53 +0000327\input{librgbimg}
Guido van Rossum40006cf1996-08-19 22:58:03 +0000328\input{libimghdr}
Fred Drake60adb361999-01-05 23:09:12 +0000329\input{libsndhdr}
Greg Ward41a28e32003-03-10 00:07:14 +0000330\input{libossaudiodev}
Guido van Rossum6938f061994-08-01 12:22:53 +0000331
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000332% Tkinter is a chapter in its own right.
Fred Drake53556862001-11-15 17:25:29 +0000333\input{tkinter}
Fred Drake53556862001-11-15 17:25:29 +0000334
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000335% % Internationalization
336\input{i18n}
337\input{libgettext}
338\input{liblocale}
339
340% =============
341% PROGRAM FRAMEWORKS
342% =============
343\input{frameworks}
344\input{libcmd}
345\input{libshlex}
346
347
348% =============
349% DEVELOPMENT TOOLS
350% =============
351% % Software development support
352\input{development}
353\input{libpydoc}
354\input{libdoctest}
355\input{libunittest}
356\input{libtest}
357
358\input{libpdb} % The Python Debugger
359
360\input{libprofile} % The Python Profiler
361\input{libhotshot} % New profiler
362\input{libtimeit}
363
364
365% =============
366% PYTHON ENGINE
367% =============
368
369% Runtime services
370\input{libpython} % Python Runtime Services
371\input{libsys}
372\input{libbltin} % really __builtin__
373\input{libmain} % really __main__
374\input{libwarnings}
375\input{libatexit}
376\input{libtraceback}
377\input{libfuture} % really __future__
378\input{libgc}
379\input{libinspect}
380\input{libsite}
381\input{libuser}
382\input{libfpectl}
383
384
385\input{custominterp} % Custom interpreter
386\input{libcode}
387\input{libcodeop}
Fred Drakeed13b4a2000-08-03 21:18:18 +0000388\input{librestricted} % Restricted Execution
389\input{librexec}
390\input{libbastion}
391
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000392
393\input{modules} % Importing Modules
394\input{libimp}
395\input{libzipimport}
396\input{libpkgutil}
397\input{libmodulefinder}
398
399
400% =============
401% PYTHON LANGUAGE & COMPILER
402% =============
403
Fred Drake7c30de62001-02-22 21:25:20 +0000404\input{language} % Python Language Services
Fred Drakeed13b4a2000-08-03 21:18:18 +0000405\input{libparser}
406\input{libsymbol}
407\input{libtoken}
408\input{libkeyword}
409\input{libtokenize}
410\input{libtabnanny}
411\input{libpyclbr}
Fred Drake7c30de62001-02-22 21:25:20 +0000412\input{libpycompile} % really py_compile
Fred Drakeed13b4a2000-08-03 21:18:18 +0000413\input{libcompileall}
414\input{libdis}
Andrew M. Kuchling8def8762004-08-07 16:53:59 +0000415\input{libpickletools}
Fred Draked61e3ea2001-07-24 16:20:13 +0000416\input{distutils}
Fred Drakeed13b4a2000-08-03 21:18:18 +0000417
Fred Drake33f4d6d2001-09-27 20:11:07 +0000418\input{compiler} % compiler package
419
Andrew M. Kuchlingb164daf2005-12-22 20:34:09 +0000420\input{libmisc} % Miscellaneous Services
421\input{libformatter}
422
423% =============
424% OTHER PLATFORM-SPECIFIC STUFF
425% =============
426
Fred Drake7c30de62001-02-22 21:25:20 +0000427%\input{libamoeba} % AMOEBA ONLY
Guido van Rossum6938f061994-08-01 12:22:53 +0000428
Fred Drake7c30de62001-02-22 21:25:20 +0000429%\input{libstdwin} % STDWIN ONLY
Guido van Rossum6938f061994-08-01 12:22:53 +0000430
Fred Drake7c30de62001-02-22 21:25:20 +0000431\input{libsgi} % SGI IRIX ONLY
Guido van Rossum6938f061994-08-01 12:22:53 +0000432\input{libal}
Sjoerd Mullenderffd6de11995-03-28 11:56:52 +0000433\input{libcd}
Guido van Rossum6938f061994-08-01 12:22:53 +0000434\input{libfl}
435\input{libfm}
436\input{libgl}
437\input{libimgfile}
Fred Drake9ea3e361999-01-20 15:55:20 +0000438\input{libjpeg}
Guido van Rossum6938f061994-08-01 12:22:53 +0000439%\input{libpanel}
440
Fred Drake7c30de62001-02-22 21:25:20 +0000441\input{libsun} % SUNOS ONLY
Fred Drake83c1a391998-02-19 18:59:48 +0000442\input{libsunaudio}
Guido van Rossum6938f061994-08-01 12:22:53 +0000443
Fred Drake7c30de62001-02-22 21:25:20 +0000444\input{windows} % MS Windows ONLY
Fred Drakec7b72db1999-02-16 19:18:38 +0000445\input{libmsvcrt}
Fred Draked1a65ff2000-06-07 04:07:48 +0000446\input{libwinreg}
Fred Drakec7b72db1999-02-16 19:18:38 +0000447\input{libwinsound}
448
Fred Drakeed773ef2000-09-21 21:35:22 +0000449\appendix
Guido van Rossum612316f1997-03-14 04:12:52 +0000450\input{libundoc}
Fred Drake36154b22001-02-01 05:21:46 +0000451
452%\chapter{Obsolete Modules}
453%\input{libcmpcache}
454%\input{libcmp}
455%\input{libni}
Fred Drake36154b22001-02-01 05:21:46 +0000456%\input{libregex}
457%\input{libregsub}
Fred Drake36154b22001-02-01 05:21:46 +0000458
Fred Drakeed773ef2000-09-21 21:35:22 +0000459\chapter{Reporting Bugs}
460\input{reportingbugs}
Guido van Rossum612316f1997-03-14 04:12:52 +0000461
Fred Draked5df09c2001-06-20 21:37:34 +0000462\chapter{History and License}
463\input{license}
464
Fred Drakef3aa0e01998-03-17 06:23:13 +0000465%
466% The ugly "%begin{latexonly}" pseudo-environments are really just to
467% keep LaTeX2HTML quiet during the \renewcommand{} macros; they're
468% not really valuable.
469%
Fred Drake0b1337d1998-01-02 02:59:09 +0000470
Fred Drakef3aa0e01998-03-17 06:23:13 +0000471%begin{latexonly}
472\renewcommand{\indexname}{Module Index}
473%end{latexonly}
Fred Drake7c30de62001-02-22 21:25:20 +0000474\input{modlib.ind} % Module Index
Fred Drakef3aa0e01998-03-17 06:23:13 +0000475
476%begin{latexonly}
Fred Drake0b1337d1998-01-02 02:59:09 +0000477\renewcommand{\indexname}{Index}
Fred Drakef3aa0e01998-03-17 06:23:13 +0000478%end{latexonly}
Fred Drake7c30de62001-02-22 21:25:20 +0000479\input{lib.ind} % Index
Guido van Rossum515834a1991-01-22 11:45:29 +0000480
481\end{document}