Python Library Reference
Next:
1. Introduction
Up:
Python Library Reference
Previous:
Front Matter
Contents
Contents
1. Introduction
2. Built-in Types, Exceptions and Functions
2.1 Built-in Types
2.1.1 Truth Value Testing
2.1.2 Boolean Operations
2.1.3 Comparisons
2.1.4 Numeric Types
2.1.5 Sequence Types
2.1.6 Mapping Types
2.1.7 Other Built-in Types
2.1.8 Special Attributes
2.2 Built-in Exceptions
2.3 Built-in Functions
3. Python Services
3.1 sys -- System-specific parameters and functions.
3.2 types -- Names for all built-in types.
3.3 UserDict -- Class wrapper for dictionary objects.
3.4 UserList -- Class wrapper for list objects.
3.5 operator -- Standard operators as functions.
3.6 traceback -- Print or retrieve a stack traceback.
3.7 pickle -- Python object serialization.
3.8 cPickle -- Alternate implementation of pickle.
3.9 copy_reg -- Register pickle support functions.
3.10 shelve -- Python object persistency.
3.11 copy -- Shallow and deep copy operations.
3.12 marshal -- Python object serialization (with different constraints).
3.13 imp -- Access the implementation of the import statement.
3.13.1 Examples
3.14 parser -- Access parse trees of Python code.
3.14.1 Creating AST Objects
3.14.2 Converting AST Objects
3.14.3 Queries on AST Objects
3.14.4 Exceptions and Error Handling
3.14.5 AST Objects
3.14.6 Examples
3.15 symbol -- Constants representing internal nodes of the parse tree.
3.16 token -- Constants representing terminal nodes of the parse tree.
3.17 keyword -- Test whether a string is a Python keyword.
3.18 code -- Code object services.
3.19 pprint -- Data pretty printer.
3.19.1 PrettyPrinter Objects
3.20 py_compile -- Compile Python source files.
3.21 compileall -- Byte-compile Python libraries.
3.22 dis -- Disassembler.
3.22.1 Python Byte Code Instructions
3.23 site -- A standard way to reference site-specific modules.
3.24 user -- A standard way to reference user-specific modules.
3.25 __builtin__ -- Built-in functions.
3.26 __main__ -- Top-level script environment.
4. String Services
4.1 string -- Common string operations.
4.2 re -- New Perl-style regular expression search and match operations.
4.2.1 Regular Expression Syntax
4.2.2 Module Contents
4.2.3 Regular Expression Objects
4.2.4 Match Objects
4.3 regex -- Regular expression search and match operations.
4.3.1 Regular Expressions
4.3.2 Module Contents
4.4 regsub -- Substitution and splitting operations that use regular expressions.
4.5 struct -- Interpret strings as packed binary data.
4.6 StringIO -- Read and write strings as if they were files.
4.7 cStringIO -- Faster version of StringIO, but not subclassable.
5. Miscellaneous Services
5.1 math -- Mathematical functions (sin() etc.).
5.2 cmath -- Mathematical functions for complex numbers.
5.3 whrandom -- Floating point pseudo-random number generator.
5.4 random -- Generate pseudo-random numbers with various distributions.
5.5 bisect -- Array bisection algorithms for binary searching.
5.5.1 Example
5.6 array -- Efficient arrays of uniformly typed numeric values.
5.7 fileinput -- Iteration over lines from multiple input streams.
5.8 calendar -- Functions that emulate the Unix cal program.
5.9 cmd -- Build line-oriented command interpreters.
5.9.1 Cmd Objects
6. Generic Operating System Services
6.1 os -- Miscellaneous OS interfaces.
6.2 time -- Time access and conversions.
6.3 getopt -- Parser for command line options.
6.4 tempfile -- Generate temporary file names.
6.5 errno -- Standard errno system symbols.
6.6 glob -- Unix shell style pathname pattern expansion.
6.7 fnmatch -- Unix shell style pathname pattern matching.
6.8 locale -- Internationalization services.
6.8.1 Background, details, hints, tips and caveats
6.8.2 For extension writers and programs that embed Python
7. Optional Operating System Services
7.1 signal -- Set handlers for asynchronous events.
7.1.1 Example
7.2 socket -- Low-level networking interface.
7.2.1 Socket Objects
7.2.2 Example
7.3 select -- Wait for I/O completion on multiple streams.
7.4 thread -- Multiple threads of control.
7.5 threading -- Higher-level threading interfaces.
7.5.1 Lock Objects
7.5.2 RLock Objects
7.5.3 Condition Objects
7.5.4 Semaphore Objects
7.5.5 Event Objects
7.5.6 Thread Objects
7.6 Queue -- A synchronized queue class.
7.6.1 Queue Objects
7.7 anydbm -- Generic interface to DBM-style database modules.
7.8 dumbdbm -- Portable implementation of the simple DBM interface.
7.9 whichdb -- Guess which DBM-style module created a given database.
7.10 zlib -- Compression and decompression compatible with gzip.
7.11 gzip -- gzip compression and decompression using files.
8. Unix Specific Services
8.1 posix -- The most common POSIX system calls.
8.2 posixpath -- Common POSIX pathname manipulations.
8.3 pwd -- The password database.
8.4 grp -- The group database.
8.5 crypt -- The crypt() function used to check Unix passwords.
8.6 dbm -- The standard ``database'' interface, based on ndbm.
8.7 gdbm -- GNU's reinterpretation of dbm.
8.8 termios -- POSIX style tty control.
8.8.1 Example
8.9 TERMIOS -- Constants used with the termios module.
8.10 fcntl -- The fcntl() and ioctl() system calls.
8.11 posixfile -- A file-like object with support for locking.
8.12 resource -- Resource usage information.
8.12.1 Resource Limits
8.12.2 Resource Usage
8.13 syslog -- Unix syslog library routines.
8.14 stat -- Utilities for interpreting stat() results.
8.15 popen2 -- Subprocesses with accessible standard I/O streams.
8.15.1 Popen3 Objects
8.16 commands -- Wrapper functions for os.popen().
9. The Python Debugger
9.1 Debugger Commands
9.2 How It Works
10. The Python Profiler
10.1 Introduction to the profiler
10.2 How Is This Profiler Different From The Old Profiler?
10.3 Instant Users Manual
10.4 What Is Deterministic Profiling?
10.5 Reference Manual
10.5.1 The Stats Class
10.6 Limitations
10.7 Calibration
10.8 Extensions -- Deriving Better Profilers
10.8.1 OldProfile Class
10.8.2 HotProfile Class
11. Internet Protocols and Support
11.1 cgi -- Common Gateway Interface support.
11.1.1 Introduction
11.1.2 Using the cgi module
11.1.3 Old classes
11.1.4 Functions
11.1.5 Caring about security
11.1.6 Installing your CGI script on a Unix system
11.1.7 Testing your CGI script
11.1.8 Debugging CGI scripts
11.1.9 Common problems and solutions
11.2 urllib -- Open an arbitrary object given by URL.
11.3 httplib -- HTTP protocol client.
11.3.1 HTTP Objects
11.3.2 Example
11.4 ftplib -- FTP protocol client.
11.4.1 FTP Objects
11.5 gopherlib -- Gopher protocol client.
11.6 poplib -- POP3 protocol client.
11.6.1 POP3 Objects
11.6.2 POP3 Example
11.7 imaplib -- IMAP4 protocol client.
11.7.1 IMAP4 Objects
11.7.2 IMAP4 Example
11.8 nntplib -- NNTP protocol client.
11.8.1 NNTP Objects
11.9 smtplib -- SMTP protocol client.
11.9.1 SMTP Objects
11.9.2 SMTP Example
11.10 urlparse -- Parse URLs into components.
11.11 SocketServer -- A framework for network servers.
11.12 BaseHTTPServer -- Basic HTTP server.
12. Internet Data Handling
12.1 sgmllib -- Simple SGML parser.
12.2 htmllib -- A parser for HTML documents.
12.3 xmllib -- A parser for XML documents.
12.4 formatter -- Generic output formatter and device interface.
12.4.1 The Formatter Interface
12.4.2 Formatter Implementations
12.4.3 The Writer Interface
12.4.4 Writer Implementations
12.5 rfc822 -- Parse RFC 822 mail headers.
12.5.1 Message Objects
12.5.2 AddressList Objects
12.6 mimetools -- Tools for parsing MIME style message bodies.
12.6.1 Additional Methods of Message objects
12.7 multifile -- Support for reading files which contain distinct parts.
12.7.1 MultiFile Objects
12.7.2 MultiFile Example
12.8 binhex -- Encode and decode files in binhex4 format.
12.8.1 Notes
12.9 uu -- Encode and decode files in uuencode format.
12.10 binascii -- Convert between binary and various ascii-encoded representations.
12.11 xdrlib -- Encode and decode XDR data.
12.11.1 Packer Objects
12.11.2 Unpacker Objects
12.11.3 Exceptions
12.12 mailcap -- Mailcap file handling.
12.13 mimetypes -- Mapping of filename extensions to MIME types.
12.14 base64 -- Encode and decode MIME base64 encoding.
12.15 quopri -- Encode and decode MIME quoted-printable encoding.
12.16 mailbox -- Read various mailbox formats.
12.16.1 Mailbox Objects
12.17 mimify -- Mimification and unmimification of mail messages.
13. Restricted Execution
13.1 rexec -- Basic restricted execution framework.
13.1.1 An example
13.2 Bastion -- Providing restricted access to objects.
14. Multimedia Services
14.1 audioop -- Manipulate raw audio data.
14.2 imageop -- Manipulate raw image data.
14.3 aifc -- Read and write audio files in AIFF or AIFC format.
14.4 jpeg -- Read and write image files in compressed JPEG format.
14.5 rgbimg -- Read and write image files in ``SGI RGB'' format.
14.6 imghdr -- Determine the type of image contained in a file or byte stream.
15. Cryptographic Services
15.1 md5 -- MD5 message digest algorithm.
15.2 mpz -- GNU MP library for arbitrary precision arithmetic.
15.3 rotor -- Enigma-like encryption and decryption.
16. SGI IRIX Specific Services
16.1 al -- Audio functions on the SGI.
16.1.1 Configuration Objects
16.1.2 Port Objects
16.2 AL -- Constants used with the al module.
16.3 cd -- Interface to the CD-ROM on Silicon Graphics systems.
16.3.1 Player Objects
16.3.2 Parser Objects
16.4 fl -- FORMS library interface for GUI applications.
16.4.1 Functions Defined in Module fl
16.4.2 Form Objects
16.4.3 FORMS Objects
16.5 FL -- Constants used with the fl module.
16.6 flp -- Loading functions for stored FORMS designs.
16.7 fm -- Font Manager interface for SGI workstations.
16.8 gl -- Functions from the Silicon Graphics Graphics Library.
16.9 DEVICE -- Constants used with the gl module.
16.10 GL -- Constants used with the gl module.
16.11 imgfile -- Support for SGI imglib files.
17. SunOS Specific Services
17.1 sunaudiodev -- Access to Sun audio hardware.
17.1.1 Audio Device Objects
18. Undocumented Modules
18.1 Frameworks; somewhat harder to document, but well worth the effort
18.2 Stuff useful to a lot of people, including the CGI crowd
18.3 Miscellaneous useful utilities
18.4 Parsing Python
18.5 Platform specific modules
18.6 Code objects and files, debugger etc.
18.7 Multimedia
18.8 Oddities
18.9 Obsolete
18.10 Extension modules
Module Index
Index
Python Library Reference
Next:
1. Introduction
Up:
Python Library Reference
Previous:
Front Matter