1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
\documentclass{manual}
% 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.
\title{Python Library Reference}
\input{boilerplate}
\makeindex % tell \index to actually write the
% .idx file
\makemodindex % ... and the module index as well.
\begin{document}
\maketitle
\ifhtml
\chapter*{Front Matter\label{front}}
\fi
\input{copyright}
\begin{abstract}
\noindent
Python is an extensible, interpreted, object-oriented programming
language. It supports a wide range of applications, from simple text
processing scripts to interactive Web browsers.
While the \citetitle[../ref/ref.html]{Python Reference Manual}
describes the exact syntax and 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
informal introduction to Python, see the
\citetitle[../tut/tut.html]{Python Tutorial}; the
\citetitle[../ref/ref.html]{Python Reference Manual} remains the
highest authority on syntactic and semantic questions. Finally, the
manual entitled \citetitle[../ext/ext.html]{Extending and Embedding
the Python Interpreter} describes how to add new extensions to Python
and how to embed it in other applications.
\end{abstract}
\tableofcontents
% Chapter title:
\input{libintro} % Introduction
% =============
% BUILT-INs
% =============
\input{libobjs} % Built-in Types, Exceptions and Functions
\input{libfuncs}
\input{libstdtypes}
\input{libexcs}
\input{libconsts}
% =============
% BASIC/GENERAL-PURPOSE OBJECTS
% =============
% Strings
\input{libstrings} % String Services
\input{libstring}
\input{libre}
\input{libreconvert}
\input{libstruct} % XXX also/better in File Formats?
\input{libdifflib}
\input{libstringio}
\input{libtextwrap}
\input{libcodecs}
\input{libunicodedata}
\input{libstringprep}
\input{libfpformat}
\input{datatypes} % Data types and structures
\input{libdatetime}
\input{libcalendar}
\input{libcollections}
\input{libheapq}
\input{libbisect}
\input{libarray}
\input{libsets}
\input{libsched}
\input{libmutex}
\input{libqueue}
\input{libweakref}
\input{libuserdict}
% General object services
% XXX intro
\input{libtypes}
\input{libnew}
\input{libcopy}
\input{libpprint}
\input{librepr}
\input{numeric} % Numeric/Mathematical modules
\input{libmath}
\input{libcmath}
\input{libdecimal}
\input{librandom}
% Functions, Functional, Generators and Iterators
% XXX intro functional
\input{libitertools}
\input{libfunctional}
\input{liboperator} % from runtime - better with itertools and functional
% =============
% DATA FORMATS
% =============
% Big move - include all the markup and internet formats here
% MIME & email stuff
\input{netdata} % Internet Data Handling
\input{email}
\input{libmailcap}
\input{libmailbox}
\input{libmhlib}
\input{libmimetools}
\input{libmimetypes}
\input{libmimewriter}
\input{libmimify}
\input{libmultifile}
\input{librfc822}
% encoding stuff
\input{libbase64}
\input{libbinascii}
\input{libbinhex}
\input{libquopri}
\input{libuu}
\input{markup} % Structured Markup Processing Tools
\input{libhtmlparser}
\input{libsgmllib}
\input{libhtmllib}
\input{libpyexpat}
\input{xmldom}
\input{xmldomminidom}
\input{xmldompulldom}
\input{xmlsax}
\input{xmlsaxhandler}
\input{xmlsaxutils}
\input{xmlsaxreader}
% \input{libxmllib}
\input{fileformats} % Miscellaneous file formats
\input{libcsv}
\input{libcfgparser}
\input{librobotparser}
\input{libnetrc}
\input{libxdrlib}
\input{libcrypto} % Cryptographic Services
\input{libhashlib}
\input{libhmac}
\input{libmd5}
\input{libsha}
% =============
% FILE & DATABASE STORAGE
% =============
\input{filesys} % File/directory support
\input{libposixpath} % os.path
\input{libfileinput}
\input{libstat}
\input{libstatvfs}
\input{libfilecmp}
\input{libtempfile}
\input{libglob}
\input{libfnmatch}
\input{liblinecache}
\input{libshutil}
\input{libdircache}
\input{archiving} % Data compression and archiving
\input{libzlib}
\input{libgzip}
\input{libbz2}
\input{libzipfile}
\input{libtarfile}
\input{persistence} % Persistent storage
\input{libpickle}
\input{libcopyreg} % really copy_reg % from runtime...
\input{libshelve}
\input{libmarshal}
\input{libanydbm}
\input{libwhichdb}
\input{libdbm}
\input{libgdbm}
\input{libdbhash}
\input{libbsddb}
\input{libdumbdbm}
% =============
% OS
% =============
\input{liballos} % Generic Operating System Services
\input{libos}
\input{libtime}
\input{liboptparse}
\input{libgetopt}
\input{liblogging}
\input{libgetpass}
\input{libcurses}
\input{libascii} % curses.ascii
\input{libcursespanel}
\input{libplatform}
\input{liberrno}
\input{libsomeos} % Optional Operating System Services
\input{libselect}
\input{libthread}
\input{libthreading}
\input{libdummythread}
\input{libdummythreading}
\input{libmmap}
\input{libreadline}
\input{librlcompleter}
\input{libunix} % UNIX Specific Services
\input{libposix}
\input{libpwd}
\input{libspwd}
\input{libgrp}
\input{libcrypt}
\input{libdl}
\input{libtermios}
\input{libtty}
\input{libpty}
\input{libfcntl}
\input{libpipes}
\input{libposixfile}
\input{libresource}
\input{libnis}
\input{libsyslog}
\input{libcommands}
% =============
% NETWORK & COMMUNICATIONS
% =============
\input{ipc} % Interprocess communication/networking
\input{libsubprocess}
\input{libsocket}
\input{libsignal}
\input{libpopen2}
\input{libasyncore}
\input{libasynchat}
\input{internet} % Internet Protocols
\input{libwebbrowser}
\input{libcgi}
\input{libcgitb}
\input{liburllib}
\input{liburllib2}
\input{libhttplib}
\input{libftplib}
\input{libgopherlib}
\input{libpoplib}
\input{libimaplib}
\input{libnntplib}
\input{libsmtplib}
\input{libsmtpd}
\input{libtelnetlib}
\input{liburlparse}
\input{libsocksvr}
\input{libbasehttp}
\input{libsimplehttp}
\input{libcgihttp}
\input{libcookielib}
\input{libcookie}
\input{libxmlrpclib}
\input{libsimplexmlrpc}
\input{libdocxmlrpc}
% =============
% MULTIMEDIA
% =============
\input{libmm} % Multimedia Services
\input{libaudioop}
\input{libimageop}
\input{libaifc}
\input{libsunau}
\input{libwave}
\input{libchunk}
\input{libcolorsys}
\input{librgbimg}
\input{libimghdr}
\input{libsndhdr}
\input{libossaudiodev}
% Tkinter is a chapter in its own right.
\input{tkinter}
% % Internationalization
\input{i18n}
\input{libgettext}
\input{liblocale}
% =============
% PROGRAM FRAMEWORKS
% =============
\input{frameworks}
\input{libcmd}
\input{libshlex}
% =============
% DEVELOPMENT TOOLS
% =============
% % Software development support
\input{development}
\input{libpydoc}
\input{libdoctest}
\input{libunittest}
\input{libtest}
\input{libpdb} % The Python Debugger
\input{libprofile} % The Python Profiler
\input{libhotshot} % unmaintained C profiler
\input{libtimeit}
% =============
% PYTHON ENGINE
% =============
% Runtime services
\input{libpython} % Python Runtime Services
\input{libsys}
\input{libbltin} % really __builtin__
\input{libmain} % really __main__
\input{libwarnings}
\input{libatexit}
\input{libtraceback}
\input{libfuture} % really __future__
\input{libgc}
\input{libinspect}
\input{libsite}
\input{libuser}
\input{libfpectl}
\input{custominterp} % Custom interpreter
\input{libcode}
\input{libcodeop}
\input{librestricted} % Restricted Execution
\input{librexec}
\input{libbastion}
\input{modules} % Importing Modules
\input{libimp}
\input{libzipimport}
\input{libpkgutil}
\input{libmodulefinder}
% =============
% PYTHON LANGUAGE & COMPILER
% =============
\input{language} % Python Language Services
\input{libparser}
\input{libsymbol}
\input{libtoken}
\input{libkeyword}
\input{libtokenize}
\input{libtabnanny}
\input{libpyclbr}
\input{libpycompile} % really py_compile
\input{libcompileall}
\input{libdis}
\input{libpickletools}
\input{distutils}
\input{compiler} % compiler package
\input{libast}
\input{libmisc} % Miscellaneous Services
\input{libformatter}
% =============
% OTHER PLATFORM-SPECIFIC STUFF
% =============
%\input{libamoeba} % AMOEBA ONLY
%\input{libstdwin} % STDWIN ONLY
\input{libsgi} % SGI IRIX ONLY
\input{libal}
\input{libcd}
\input{libfl}
\input{libfm}
\input{libgl}
\input{libimgfile}
\input{libjpeg}
%\input{libpanel}
\input{libsun} % SUNOS ONLY
\input{libsunaudio}
\input{windows} % MS Windows ONLY
\input{libmsvcrt}
\input{libwinreg}
\input{libwinsound}
\appendix
\input{libundoc}
%\chapter{Obsolete Modules}
%\input{libcmpcache}
%\input{libcmp}
%\input{libni}
%\input{libregex}
%\input{libregsub}
\chapter{Reporting Bugs}
\input{reportingbugs}
\chapter{History and License}
\input{license}
%
% The ugly "%begin{latexonly}" pseudo-environments are really just to
% keep LaTeX2HTML quiet during the \renewcommand{} macros; they're
% not really valuable.
%
%begin{latexonly}
\renewcommand{\indexname}{Module Index}
%end{latexonly}
\input{modlib.ind} % Module Index
%begin{latexonly}
\renewcommand{\indexname}{Index}
%end{latexonly}
\input{lib.ind} % Index
\end{document}
|