Up:
Python Documentation Index
Next:
Front Matter
Python Library Reference
Guido van Rossum
Python Software Foundation Email: [email protected]
Fred L. Drake, Jr., editor
Release 2.4.4c1
11 October 2006
- Front Matter
- Contents
- 1. Introduction
- 2. Built-In Objects
- 2.1 Built-in Functions
- 2.2 Non-essential Built-in Functions
- 2.3 Built-in Types
- 2.3.1 Truth Value Testing
- 2.3.2 Boolean Operations -- and, or, not
- 2.3.3 Comparisons
- 2.3.4 Numeric Types -- int, float, long, complex
- 2.3.5 Iterator Types
- 2.3.6 Sequence Types -- str, unicode, list, tuple, buffer, xrange
- 2.3.7 Set Types -- set, frozenset
- 2.3.8 Mapping Types -- classdict
- 2.3.9 File Objects
- 2.3.10 Other Built-in Types
- 2.3.11 Special Attributes
- 2.4 Built-in Exceptions
- 2.5 Built-in Constants
- 3. Python Runtime Services
- 3.1 sys -- System-specific parameters and functions
- 3.2 gc -- Garbage Collector interface
- 3.3 weakref -- Weak references
- 3.4 fpectl -- Floating point exception control
- 3.5 atexit -- Exit handlers
- 3.6 types -- Names for built-in types
- 3.7 UserDict -- Class wrapper for dictionary objects
- 3.8 UserList -- Class wrapper for list objects
- 3.9 UserString -- Class wrapper for string objects
- 3.10 operator -- Standard operators as functions.
- 3.11 inspect -- Inspect live objects
- 3.12 traceback -- Print or retrieve a stack traceback
- 3.13 linecache -- Random access to text lines
- 3.14 pickle -- Python object serialization
- 3.15 cPickle -- A faster pickle
- 3.16 copy_reg -- Register pickle support functions
- 3.17 shelve -- Python object persistence
- 3.18 copy -- Shallow and deep copy operations
- 3.19 marshal -- Internal Python object serialization
- 3.20 warnings -- Warning control
- 3.21 imp -- Access the import internals
- 3.22 zipimport -- Import modules from Zip archives
- 3.23 pkgutil -- Package extension utility
- 3.24 modulefinder -- Find modules used by a script
- 3.25 code -- Interpreter base classes
- 3.26 codeop -- Compile Python code
- 3.27 pprint -- Data pretty printer
- 3.28 repr -- Alternate repr() implementation
- 3.29 new -- Creation of runtime internal objects
- 3.30 site -- Site-specific configuration hook
- 3.31 user -- User-specific configuration hook
- 3.32 __builtin__ -- Built-in objects
- 3.33 __main__ -- Top-level script environment
- 3.34 __future__ -- Future statement definitions
- 4. String Services
- 4.1 string -- Common string operations
- 4.2 re -- Regular expression operations
- 4.3 struct -- Interpret strings as packed binary data
- 4.4 difflib -- Helpers for computing deltas
- 4.5 fpformat -- Floating point conversions
- 4.6 StringIO -- Read and write strings as files
- 4.7 cStringIO -- Faster version of StringIO
- 4.8 textwrap -- Text wrapping and filling
- 4.9 codecs -- Codec registry and base classes
- 4.10 unicodedata -- Unicode Database
- 4.11 stringprep -- Internet String Preparation
- 5. Miscellaneous Services
- 5.1 pydoc -- Documentation generator and online help system
- 5.2 doctest -- Test interactive Python examples
- 5.3 unittest -- Unit testing framework
- 5.4 test -- Regression tests package for Python
- 5.5 test.test_support -- Utility functions for tests
- 5.6 decimal -- Decimal floating point arithmetic
- 5.7 math -- Mathematical functions
- 5.8 cmath -- Mathematical functions for complex numbers
- 5.9 random -- Generate pseudo-random numbers
- 5.10 whrandom -- Pseudo-random number generator
- 5.11 bisect -- Array bisection algorithm
- 5.12 collections -- High-performance container datatypes
- 5.13 heapq -- Heap queue algorithm
- 5.14 array -- Efficient arrays of numeric values
- 5.15 sets -- Unordered collections of unique elements
- 5.16 itertools -- Functions creating iterators for efficient looping
- 5.17 ConfigParser -- Configuration file parser
- 5.18 fileinput -- Iterate over lines from multiple input streams
- 5.19 calendar -- General calendar-related functions
- 5.20 cmd -- Support for line-oriented command interpreters
- 5.21 shlex -- Simple lexical analysis
- 6. Generic Operating System Services
- 6.1 os -- Miscellaneous operating system interfaces
- 6.2 os.path -- Common pathname manipulations
- 6.3 dircache -- Cached directory listings
- 6.4 stat -- Interpreting stat() results
- 6.5 statcache -- An optimization of os.stat()
- 6.6 statvfs -- Constants used with os.statvfs()
- 6.7 filecmp -- File and Directory Comparisons
- 6.8 subprocess -- Subprocess management
- 6.9 popen2 -- Subprocesses with accessible I/O streams
- 6.10 datetime -- Basic date and time types
- 6.11 time -- Time access and conversions
- 6.12 sched -- Event scheduler
- 6.13 mutex -- Mutual exclusion support
- 6.14 getpass -- Portable password input
- 6.15 curses -- Terminal handling for character-cell displays
- 6.16 curses.textpad -- Text input widget for curses programs
- 6.17 curses.wrapper -- Terminal handler for curses programs
- 6.18 curses.ascii -- Utilities for ASCII characters
- 6.19 curses.panel -- A panel stack extension for curses.
- 6.20 getopt -- Parser for command line options
- 6.21 optparse -- More powerful command line option parser
- 6.22 tempfile -- Generate temporary files and directories
- 6.23 errno -- Standard errno system symbols
- 6.24 glob -- Unix style pathname pattern expansion
- 6.25 fnmatch -- Unix filename pattern matching
- 6.26 shutil -- High-level file operations
- 6.27 locale -- Internationalization services
- 6.28 gettext -- Multilingual internationalization services
- 6.29 logging -- Logging facility for Python
- 6.30 platform -- Access to underlying platform's identifying data.
- 7. Optional Operating System Services
- 7.1 signal -- Set handlers for asynchronous events
- 7.2 socket -- Low-level networking interface
- 7.3 select -- Waiting for I/O completion
- 7.4 thread -- Multiple threads of control
- 7.5 threading -- Higher-level threading interface
- 7.6 dummy_thread -- Drop-in replacement for the thread module
- 7.7 dummy_threading -- Drop-in replacement for the threading module
- 7.8 Queue -- A synchronized queue class
- 7.9 mmap -- Memory-mapped file support
- 7.10 anydbm -- Generic access to DBM-style databases
- 7.11 dbhash -- DBM-style interface to the BSD database library
- 7.12 whichdb -- Guess which DBM module created a database
- 7.13 bsddb -- Interface to Berkeley DB library
- 7.14 dumbdbm -- Portable DBM implementation
- 7.15 zlib -- Compression compatible with gzip
- 7.16 gzip -- Support for gzip files
- 7.17 bz2 -- Compression compatible with bzip2
- 7.18 zipfile -- Work with ZIP archives
- 7.19 tarfile -- Read and write tar archive files
- 7.20 readline -- GNU readline interface
- 7.21 rlcompleter -- Completion function for GNU readline
- 8. Unix Specific Services
- 8.1 posix -- The most common POSIX system calls
- 8.2 pwd -- The password database
- 8.3 grp -- The group database
- 8.4 crypt -- Function to check Unix passwords
- 8.5 dl -- Call C functions in shared objects
- 8.6 dbm -- Simple ``database'' interface
- 8.7 gdbm -- GNU's reinterpretation of dbm
- 8.8 termios -- POSIX style tty control
- 8.9 tty -- Terminal control functions
- 8.10 pty -- Pseudo-terminal utilities
- 8.11 fcntl -- The fcntl() and ioctl() system calls
- 8.12 pipes -- Interface to shell pipelines
- 8.13 posixfile -- File-like objects with locking support
- 8.14 resource -- Resource usage information
- 8.15 nis -- Interface to Sun's NIS (Yellow Pages)
- 8.16 syslog -- Unix syslog library routines
- 8.17 commands -- Utilities for running commands
- 9. The Python Debugger
- 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.6 Limitations
- 10.7 Calibration
- 10.8 Extensions -- Deriving Better Profilers
- 10.9 hotshot -- High performance logging profiler
- 10.10 timeit -- Measure execution time of small code snippets
- 11. Internet Protocols and Support
- 11.1 webbrowser -- Convenient Web-browser controller
- 11.2 cgi -- Common Gateway Interface support.
- 11.3 cgitb -- Traceback manager for CGI scripts
- 11.4 urllib -- Open arbitrary resources by URL
- 11.5 urllib2 --
extensible library for opening URLs
- 11.5.1 Request Objects
- 11.5.2 OpenerDirector Objects
- 11.5.3 BaseHandler Objects
- 11.5.4 HTTPRedirectHandler Objects
- 11.5.5 HTTPCookieProcessor Objects
- 11.5.6 ProxyHandler Objects
- 11.5.7 HTTPPasswordMgr Objects
- 11.5.8 AbstractBasicAuthHandler Objects
- 11.5.9 HTTPBasicAuthHandler Objects
- 11.5.10 ProxyBasicAuthHandler Objects
- 11.5.11 AbstractDigestAuthHandler Objects
- 11.5.12 HTTPDigestAuthHandler Objects
- 11.5.13 ProxyDigestAuthHandler Objects
- 11.5.14 HTTPHandler Objects
- 11.5.15 HTTPSHandler Objects
- 11.5.16 FileHandler Objects
- 11.5.17 FTPHandler Objects
- 11.5.18 CacheFTPHandler Objects
- 11.5.19 GopherHandler Objects
- 11.5.20 UnknownHandler Objects
- 11.5.21 HTTPErrorProcessor Objects
- 11.5.22 Examples
- 11.6 httplib -- HTTP protocol client
- 11.7 ftplib -- FTP protocol client
- 11.8 gopherlib -- Gopher protocol client
- 11.9 poplib -- POP3 protocol client
- 11.10 imaplib -- IMAP4 protocol client
- 11.11 nntplib -- NNTP protocol client
- 11.12 smtplib -- SMTP protocol client
- 11.13 smtpd -- SMTP Server
- 11.14 telnetlib -- Telnet client
- 11.15 urlparse -- Parse URLs into components
- 11.16 SocketServer -- A framework for network servers
- 11.17 BaseHTTPServer -- Basic HTTP server
- 11.18 SimpleHTTPServer -- Simple HTTP request handler
- 11.19 CGIHTTPServer -- CGI-capable HTTP request handler
- 11.20 cookielib -- Cookie handling for HTTP clients
- 11.21 Cookie -- HTTP state management
- 11.22 xmlrpclib -- XML-RPC client access
- 11.23 SimpleXMLRPCServer -- Basic XML-RPC server
- 11.24 DocXMLRPCServer -- Self-documenting XML-RPC server
- 11.25 asyncore -- Asynchronous socket handler
- 11.26 asynchat -- Asynchronous socket command/response handler
- 12. Internet Data Handling
- 12.1 formatter -- Generic output formatting
- 12.2 email --
An email and MIME handling package
- 12.2.1 Representing an email message
- 12.2.2 Parsing email messages
- 12.2.3 Generating MIME documents
- 12.2.4 Creating email and MIME objects from scratch
- 12.2.5 Internationalized headers
- 12.2.6 Representing character sets
- 12.2.7 Encoders
- 12.2.8 Exception and Defect classes
- 12.2.9 Miscellaneous utilities
- 12.2.10 Iterators
- 12.2.11 Package History
- 12.2.12 Differences from mimelib
- 12.2.13 Examples
- 12.3 mailcap -- Mailcap file handling.
- 12.4 mailbox -- Read various mailbox formats
- 12.5 mhlib -- Access to MH mailboxes
- 12.6 mimetools -- Tools for parsing MIME messages
- 12.7 mimetypes -- Map filenames to MIME types
- 12.8 MimeWriter -- Generic MIME file writer
- 12.9 mimify -- MIME processing of mail messages
- 12.10 multifile -- Support for files containing distinct parts
- 12.11 rfc822 -- Parse RFC 2822 mail headers
- 12.12 base64 -- RFC 3548: Base16, Base32, Base64 Data Encodings
- 12.13 binascii -- Convert between binary and ASCII
- 12.14 binhex -- Encode and decode binhex4 files
- 12.15 quopri -- Encode and decode MIME quoted-printable data
- 12.16 uu -- Encode and decode uuencode files
- 12.17 xdrlib -- Encode and decode XDR data
- 12.18 netrc -- netrc file processing
- 12.19 robotparser -- Parser for robots.txt
- 12.20 csv -- CSV File Reading and Writing
- 13. Structured Markup Processing Tools
- 13.1 HTMLParser -- Simple HTML and XHTML parser
- 13.2 sgmllib -- Simple SGML parser
- 13.3 htmllib -- A parser for HTML documents
- 13.4 htmlentitydefs -- Definitions of HTML general entities
- 13.5 xml.parsers.expat -- Fast XML parsing using Expat
- 13.6 xml.dom -- The Document Object Model API
- 13.7 xml.dom.minidom -- Lightweight DOM implementation
- 13.8 xml.dom.pulldom -- Support for building partial DOM trees
- 13.9 xml.sax -- Support for SAX2 parsers
- 13.10 xml.sax.handler -- Base classes for SAX handlers
- 13.11 xml.sax.saxutils -- SAX Utilities
- 13.12 xml.sax.xmlreader -- Interface for XML parsers
- 13.13 xmllib -- A parser for XML documents
- 14. Multimedia Services
- 14.1 audioop -- Manipulate raw audio data
- 14.2 imageop -- Manipulate raw image data
- 14.3 aifc -- Read and write AIFF and AIFC files
- 14.4 sunau -- Read and write Sun AU files
- 14.5 wave -- Read and write WAV files
- 14.6 chunk -- Read IFF chunked data
- 14.7 colorsys -- Conversions between color systems
- 14.8 rgbimg -- Read and write ``SGI RGB'' files
- 14.9 imghdr -- Determine the type of an image
- 14.10 sndhdr -- Determine type of sound file
- 14.11 ossaudiodev -- Access to OSS-compatible audio devices
- 15. Cryptographic Services
- 16. Graphical User Interfaces with Tk
- 17. Restricted Execution
- 18. Python Language Services
- 18.1 parser -- Access Python parse trees
- 18.2 symbol -- Constants used with Python parse trees
- 18.3 token -- Constants used with Python parse trees
- 18.4 keyword -- Testing for Python keywords
- 18.5 tokenize -- Tokenizer for Python source
- 18.6 tabnanny -- Detection of ambiguous indentation
- 18.7 pyclbr -- Python class browser support
- 18.8 py_compile -- Compile Python source files
- 18.9 compileall -- Byte-compile Python libraries
- 18.10 dis -- Disassembler for Python byte code
- 18.11 pickletools -- Tools for pickle developers.
- 18.12 distutils -- Building and installing Python modules
- 19. Python compiler package
- 20. SGI IRIX Specific Services
- 20.1 al -- Audio functions on the SGI
- 20.2 AL -- Constants used with the al module
- 20.3 cd -- CD-ROM access on SGI systems
- 20.4 fl -- FORMS library for graphical user interfaces
- 20.5 FL -- Constants used with the fl module
- 20.6 flp -- Functions for loading stored FORMS designs
- 20.7 fm -- Font Manager interface
- 20.8 gl -- Graphics Library interface
- 20.9 DEVICE -- Constants used with the gl module
- 20.10 GL -- Constants used with the gl module
- 20.11 imgfile -- Support for SGI imglib files
- 20.12 jpeg -- Read and write JPEG files
- 21. SunOS Specific Services
- 22. MS Windows Specific Services
- A. Undocumented Modules
- B. Reporting Bugs
- C. History and License
- Module Index
- Index
- About this document ...
Release 2.4.4c1, documentation updated on 11 October 2006.