• Tut
  • Ref
  • Lib
  • Api
  • Ext
  • Mod
  • image-search

2.5.1

  • Front Matter
  • Contents
  • 1. Whetting Your Appetite
  • image-plus2. Using the Python Interpreter
    • image-plus2.1 Invoking the Interpreter
      • 2.1.1 Argument Passing
      • 2.1.2 Interactive Mode
    • image-plus2.2 The Interpreter and Its Environment
      • 2.2.1 Error Handling
      • 2.2.2 Executable Python Scripts
      • 2.2.3 Source Code Encoding
      • 2.2.4 The Interactive Startup File
  • image-plus3. An Informal Introduction to Python
    • image-plus3.1 Using Python as a Calculator
      • 3.1.1 Numbers
      • 3.1.2 Strings
      • 3.1.3 Unicode Strings
      • 3.1.4 Lists
    • 3.2 First Steps Towards Programming
  • image-plus4. More Control Flow Tools
    • 4.1 if Statements
    • 4.2 for Statements
    • 4.3 The range() Function
    • 4.4 break and continue Statements, and else Clauses on Loops
    • 4.5 pass Statements
    • 4.6 Defining Functions
    • image-plus4.7 More on Defining Functions
      • 4.7.1 Default Argument Values
      • 4.7.2 Keyword Arguments
      • 4.7.3 Arbitrary Argument Lists
      • 4.7.4 Unpacking Argument Lists
      • 4.7.5 Lambda Forms
      • 4.7.6 Documentation Strings
  • image-plus5. Data Structures
    • image-plus5.1 More on Lists
      • 5.1.1 Using Lists as Stacks
      • 5.1.2 Using Lists as Queues
      • 5.1.3 Functional Programming Tools
      • 5.1.4 List Comprehensions
    • 5.2 The del statement
    • 5.3 Tuples and Sequences
    • 5.4 Sets
    • 5.5 Dictionaries
    • 5.6 Looping Techniques
    • 5.7 More on Conditions
    • 5.8 Comparing Sequences and Other Types
  • image-plus6. Modules
    • image-plus6.1 More on Modules
      • 6.1.1 The Module Search Path
      • 6.1.2 ``Compiled'' Python files
    • 6.2 Standard Modules
    • 6.3 The dir() Function
    • image-plus6.4 Packages
      • 6.4.1 Importing * From a Package
      • 6.4.2 Intra-package References
      • 6.4.3 Packages in Multiple Directories
  • image-plus7. Input and Output
    • 7.1 Fancier Output Formatting
    • image-plus7.2 Reading and Writing Files
      • 7.2.1 Methods of File Objects
      • 7.2.2 The pickle Module
  • image-plus8. Errors and Exceptions
    • 8.1 Syntax Errors
    • 8.2 Exceptions
    • 8.3 Handling Exceptions
    • 8.4 Raising Exceptions
    • 8.5 User-defined Exceptions
    • 8.6 Defining Clean-up Actions
    • 8.7 Predefined Clean-up Actions
  • image-plus9. Classes
    • 9.1 A Word About Terminology
    • 9.2 Python Scopes and Name Spaces
    • image-plus9.3 A First Look at Classes
      • 9.3.1 Class Definition Syntax
      • 9.3.2 Class Objects
      • 9.3.3 Instance Objects
      • 9.3.4 Method Objects
    • 9.4 Random Remarks
    • image-plus9.5 Inheritance
      • 9.5.1 Multiple Inheritance
    • 9.6 Private Variables
    • 9.7 Odds and Ends
    • 9.8 Exceptions Are Classes Too
    • 9.9 Iterators
    • 9.10 Generators
    • 9.11 Generator Expressions
  • image-plus10. Brief Tour of the Standard Library
    • 10.1 Operating System Interface
    • 10.2 File Wildcards
    • 10.3 Command Line Arguments
    • 10.4 Error Output Redirection and Program Termination
    • 10.5 String Pattern Matching
    • 10.6 Mathematics
    • 10.7 Internet Access
    • 10.8 Dates and Times
    • 10.9 Data Compression
    • 10.10 Performance Measurement
    • 10.11 Quality Control
    • 10.12 Batteries Included
  • image-plus11. Brief Tour of the Standard Library - Part II
    • 11.1 Output Formatting
    • 11.2 Templating
    • 11.3 Working with Binary Data Record Layouts
    • 11.4 Multi-threading
    • 11.5 Logging
    • 11.6 Weak References
    • 11.7 Tools for Working with Lists
    • 11.8 Decimal Floating Point Arithmetic
  • 12. What Now?
  • image-plusA. Interactive Input Editing and History Substitution
    • A.1 Line Editing
    • A.2 History Substitution
    • A.3 Key Bindings
    • A.4 Commentary
  • image-plusB. Floating Point Arithmetic: Issues and Limitations
    • B.1 Representation Error
  • image-plusC. History and License
    • C.1 History of the software
    • C.2 Terms and conditions for accessing or otherwise using Python
    • image-plusC.3 Licenses and Acknowledgements for Incorporated Software
      • C.3.1 Mersenne Twister
      • C.3.2 Sockets
      • C.3.3 Floating point exception control
      • C.3.4 MD5 message digest algorithm
      • C.3.5 Asynchronous socket services
      • C.3.6 Cookie management
      • C.3.7 Profiling
      • C.3.8 Execution tracing
      • C.3.9 UUencode and UUdecode functions
      • C.3.10 XML Remote Procedure Calls
  • D. Glossary
  • Index
  • About this document ...
  • Front Matter
  • Contents
  • image-plus1. Introduction
    • 1.1 Alternate Implementations
    • 1.2 Notation
  • image-plus2. Lexical analysis
    • image-plus2.1 Line structure
      • 2.1.1 Logical lines
      • 2.1.2 Physical lines
      • 2.1.3 Comments
      • 2.1.4 Encoding declarations
      • 2.1.5 Explicit line joining
      • 2.1.6 Implicit line joining
      • 2.1.7 Blank lines
      • 2.1.8 Indentation
      • 2.1.9 Whitespace between tokens
    • 2.2 Other tokens
    • image-plus2.3 Identifiers and keywords
      • 2.3.1 Keywords
      • 2.3.2 Reserved classes of identifiers
    • image-plus2.4 Literals
      • 2.4.1 String literals
      • 2.4.2 String literal concatenation
      • 2.4.3 Numeric literals
      • 2.4.4 Integer and long integer literals
      • 2.4.5 Floating point literals
      • 2.4.6 Imaginary literals
    • 2.5 Operators
    • 2.6 Delimiters
  • image-plus3. Data model
    • 3.1 Objects, values and types
    • 3.2 The standard type hierarchy
    • 3.3 New-style and classic classes
    • image-plus3.4 Special method names
      • 3.4.1 Basic customization
      • 3.4.2 Customizing attribute access
      • 3.4.3 Customizing class creation
      • 3.4.4 Emulating callable objects
      • 3.4.5 Emulating container types
      • 3.4.6 Additional methods for emulation of sequence types
      • 3.4.7 Emulating numeric types
      • 3.4.8 Coercion rules
      • 3.4.9 With Statement Context Managers
  • image-plus4. Execution model
    • image-plus4.1 Naming and binding
      • 4.1.1 Interaction with dynamic features
    • 4.2 Exceptions
  • image-plus5. Expressions
    • 5.1 Arithmetic conversions
    • image-plus5.2 Atoms
      • 5.2.1 Identifiers (Names)
      • 5.2.2 Literals
      • 5.2.3 Parenthesized forms
      • 5.2.4 List displays
      • 5.2.5 Generator expressions
      • 5.2.6 Dictionary displays
      • 5.2.7 String conversions
      • 5.2.8 Yield expressions
    • image-plus5.3 Primaries
      • 5.3.1 Attribute references
      • 5.3.2 Subscriptions
      • 5.3.3 Slicings
      • 5.3.4 Calls
    • 5.4 The power operator
    • 5.5 Unary arithmetic operations
    • 5.6 Binary arithmetic operations
    • 5.7 Shifting operations
    • 5.8 Binary bit-wise operations
    • 5.9 Comparisons
    • 5.10 Boolean operations
    • 5.11 Lambdas
    • 5.12 Expression lists
    • 5.13 Evaluation order
    • 5.14 Summary
  • image-plus6. Simple statements
    • 6.1 Expression statements
    • 6.2 Assert statements
    • image-plus6.3 Assignment statements
      • 6.3.1 Augmented assignment statements
    • 6.4 The pass statement
    • 6.5 The del statement
    • 6.6 The print statement
    • 6.7 The return statement
    • 6.8 The yield statement
    • 6.9 The raise statement
    • 6.10 The break statement
    • 6.11 The continue statement
    • image-plus6.12 The import statement
      • 6.12.1 Future statements
    • 6.13 The global statement
    • 6.14 The exec statement
  • image-plus7. Compound statements
    • 7.1 The if statement
    • 7.2 The while statement
    • 7.3 The for statement
    • 7.4 The try statement
    • 7.5 The with statement
    • 7.6 Function definitions
    • 7.7 Class definitions
  • image-plus8. Top-level components
    • 8.1 Complete Python programs
    • 8.2 File input
    • 8.3 Interactive input
    • 8.4 Expression input
  • image-plusA. History and License
    • A.1 History of the software
    • A.2 Terms and conditions for accessing or otherwise using Python
    • image-plusA.3 Licenses and Acknowledgements for Incorporated Software
      • A.3.1 Mersenne Twister
      • A.3.2 Sockets
      • A.3.3 Floating point exception control
      • A.3.4 MD5 message digest algorithm
      • A.3.5 Asynchronous socket services
      • A.3.6 Cookie management
      • A.3.7 Profiling
      • A.3.8 Execution tracing
      • A.3.9 UUencode and UUdecode functions
      • A.3.10 XML Remote Procedure Calls
  • Index
  • About this document ...
  • Front Matter
  • Contents
  • 1. Introduction
  • image-plus2. Built-in Objects
    • 2.1 Built-in Functions
    • 2.2 Non-essential Built-in Functions
    • 2.3 Built-in Exceptions
    • 2.4 Built-in Constants
  • image-plus3. Built-in Types
    • 3.1 Truth Value Testing
    • 3.2 Boolean Operations -- and, or, not
    • 3.3 Comparisons
    • image-plus3.4 Numeric Types -- int, float, long, complex
      • 3.4.1 Bit-string Operations on Integer Types
    • 3.5 Iterator Types
    • image-plus3.6 Sequence Types -- str, unicode, list, tuple, buffer, xrange
      • 3.6.1 String Methods
      • 3.6.2 String Formatting Operations
      • 3.6.3 XRange Type
      • 3.6.4 Mutable Sequence Types
    • 3.7 Set Types -- set, frozenset
    • 3.8 Mapping Types -- dict
    • 3.9 File Objects
    • 3.10 Context Manager Types
    • image-plus3.11 Other Built-in Types
      • 3.11.1 Modules
      • 3.11.2 Classes and Class Instances
      • 3.11.3 Functions
      • 3.11.4 Methods
      • 3.11.5 Code Objects
      • 3.11.6 Type Objects
      • 3.11.7 The Null Object
      • 3.11.8 The Ellipsis Object
      • 3.11.9 Boolean Values
      • 3.11.10 Internal Objects
    • 3.12 Special Attributes
  • image-plus4. String Services
    • image-plus4.1 string -- Common string operations
      • 4.1.1 String constants
      • 4.1.2 Template strings
      • 4.1.3 String functions
      • 4.1.4 Deprecated string functions
    • image-plus4.2 re -- Regular expression operations
      • 4.2.1 Regular Expression Syntax
      • 4.2.2 Matching vs Searching
      • 4.2.3 Module Contents
      • 4.2.4 Regular Expression Objects
      • 4.2.5 Match Objects
      • 4.2.6 Examples
    • image-plus4.3 struct -- Interpret strings as packed binary data
      • 4.3.1 Struct Objects
    • image-plus4.4 difflib -- Helpers for computing deltas
      • 4.4.1 SequenceMatcher Objects
      • 4.4.2 SequenceMatcher Examples
      • 4.4.3 Differ Objects
      • 4.4.4 Differ Example
    • 4.5 StringIO -- Read and write strings as files
    • 4.6 cStringIO -- Faster version of StringIO
    • 4.7 textwrap -- Text wrapping and filling
    • image-plus4.8 codecs -- Codec registry and base classes
      • 4.8.1 Codec Base Classes
      • 4.8.2 Encodings and Unicode
      • 4.8.3 Standard Encodings
      • 4.8.4 encodings.idna -- Internationalized Domain Names in Applications
      • 4.8.5 encodings.utf_8_sig -- UTF-8 codec with BOM signature
    • 4.9 unicodedata -- Unicode Database
    • 4.10 stringprep -- Internet String Preparation
    • 4.11 fpformat -- Floating point conversions
  • image-plus5. Data Types
    • image-plus5.1 datetime -- Basic date and time types
      • 5.1.1 Available Types
      • 5.1.2 timedelta Objects
      • 5.1.3 date Objects
      • 5.1.4 datetime Objects
      • 5.1.5 time Objects
      • 5.1.6 tzinfo Objects
      • 5.1.7 strftime() Behavior
    • 5.2 calendar -- General calendar-related functions
    • image-plus5.3 collections -- High-performance container datatypes
      • 5.3.1 deque objects
      • 5.3.2 defaultdict objects
    • image-plus5.4 heapq -- Heap queue algorithm
      • 5.4.1 Theory
    • image-plus5.5 bisect -- Array bisection algorithm
      • 5.5.1 Examples
    • 5.6 array -- Efficient arrays of numeric values
    • image-plus5.7 sets -- Unordered collections of unique elements
      • 5.7.1 Set Objects
      • 5.7.2 Example
      • 5.7.3 Protocol for automatic conversion to immutable
      • 5.7.4 Comparison to the built-in set types
    • image-plus5.8 sched -- Event scheduler
      • 5.8.1 Scheduler Objects
    • image-plus5.9 mutex -- Mutual exclusion support
      • 5.9.1 Mutex Objects
    • image-plus5.10 Queue -- A synchronized queue class
      • 5.10.1 Queue Objects
    • image-plus5.11 weakref -- Weak references
      • 5.11.1 Weak Reference Objects
      • 5.11.2 Example
    • 5.12 UserDict -- Class wrapper for dictionary objects
    • 5.13 UserList -- Class wrapper for list objects
    • 5.14 UserString -- Class wrapper for string objects
    • 5.15 types -- Names for built-in types
    • 5.16 new -- Creation of runtime internal objects
    • 5.17 copy -- Shallow and deep copy operations
    • image-plus5.18 pprint -- Data pretty printer
      • 5.18.1 PrettyPrinter Objects
    • image-plus5.19 repr -- Alternate repr() implementation
      • 5.19.1 Repr Objects
      • 5.19.2 Subclassing Repr Objects
  • image-plus6. Numeric and Mathematical Modules
    • 6.1 math -- Mathematical functions
    • 6.2 cmath -- Mathematical functions for complex numbers
    • image-plus6.3 decimal -- Decimal floating point arithmetic
      • 6.3.1 Quick-start Tutorial
      • 6.3.2 Decimal objects
      • 6.3.3 Context objects
      • 6.3.4 Signals
      • 6.3.5 Floating Point Notes
      • 6.3.6 Working with threads
      • 6.3.7 Recipes
      • 6.3.8 Decimal FAQ
    • 6.4 random -- Generate pseudo-random numbers
    • image-plus6.5 itertools -- Functions creating iterators for efficient looping
      • 6.5.1 Itertool functions
      • 6.5.2 Examples
      • 6.5.3 Recipes
    • image-plus6.6 functools -- Higher order functions and operations on callable objects.
      • 6.6.1 partial Objects
    • image-plus6.7 operator -- Standard operators as functions.
      • 6.7.1 Mapping Operators to Functions
  • image-plus7. Internet Data Handling
    • image-plus7.1 email -- An email and MIME handling package
      • 7.1.1 Representing an email message
      • 7.1.2 Parsing email messages
      • 7.1.3 Generating MIME documents
      • 7.1.4 Creating email and MIME objects from scratch
      • 7.1.5 Internationalized headers
      • 7.1.6 Representing character sets
      • 7.1.7 Encoders
      • 7.1.8 Exception and Defect classes
      • 7.1.9 Miscellaneous utilities
      • 7.1.10 Iterators
      • 7.1.11 Package History
      • 7.1.12 Differences from mimelib
      • 7.1.13 Examples
    • 7.2 mailcap -- Mailcap file handling.
    • image-plus7.3 mailbox -- Manipulate mailboxes in various formats
      • 7.3.1 Mailbox objects
      • 7.3.2 Message objects
      • 7.3.3 Exceptions
      • 7.3.4 Deprecated classes and methods
      • 7.3.5 Examples
    • image-plus7.4 mhlib -- Access to MH mailboxes
      • 7.4.1 MH Objects
      • 7.4.2 Folder Objects
      • 7.4.3 Message Objects
    • image-plus7.5 mimetools -- Tools for parsing MIME messages
      • 7.5.1 Additional Methods of Message Objects
    • image-plus7.6 mimetypes -- Map filenames to MIME types
      • 7.6.1 MimeTypes Objects
    • image-plus7.7 MimeWriter -- Generic MIME file writer
      • 7.7.1 MimeWriter Objects
    • 7.8 mimify -- MIME processing of mail messages
    • image-plus7.9 multifile -- Support for files containing distinct parts
      • 7.9.1 MultiFile Objects
      • 7.9.2 MultiFile Example
    • image-plus7.10 rfc822 -- Parse RFC 2822 mail headers
      • 7.10.1 Message Objects
      • 7.10.2 AddressList Objects
    • 7.11 base64 -- RFC 3548: Base16, Base32, Base64 Data Encodings
    • image-plus7.12 binhex -- Encode and decode binhex4 files
      • 7.12.1 Notes
    • 7.13 binascii -- Convert between binary and ASCII
    • 7.14 quopri -- Encode and decode MIME quoted-printable data
    • 7.15 uu -- Encode and decode uuencode files
  • image-plus8. Structured Markup Processing Tools
    • image-plus8.1 HTMLParser -- Simple HTML and XHTML parser
      • 8.1.1 Example HTML Parser Application
    • 8.2 sgmllib -- Simple SGML parser
    • image-plus8.3 htmllib -- A parser for HTML documents
      • 8.3.1 HTMLParser Objects
    • 8.4 htmlentitydefs -- Definitions of HTML general entities
    • image-plus8.5 xml.parsers.expat -- Fast XML parsing using Expat
      • 8.5.1 XMLParser Objects
      • 8.5.2 ExpatError Exceptions
      • 8.5.3 Example
      • 8.5.4 Content Model Descriptions
      • 8.5.5 Expat error constants
    • image-plus8.6 xml.dom -- The Document Object Model API
      • 8.6.1 Module Contents
      • 8.6.2 Objects in the DOM
      • 8.6.3 Conformance
    • image-plus8.7 xml.dom.minidom -- Lightweight DOM implementation
      • 8.7.1 DOM Objects
      • 8.7.2 DOM Example
      • 8.7.3 minidom and the DOM standard
    • image-plus8.8 xml.dom.pulldom -- Support for building partial DOM trees
      • 8.8.1 DOMEventStream Objects
    • image-plus8.9 xml.sax -- Support for SAX2 parsers
      • 8.9.1 SAXException Objects
    • image-plus8.10 xml.sax.handler -- Base classes for SAX handlers
      • 8.10.1 ContentHandler Objects
      • 8.10.2 DTDHandler Objects
      • 8.10.3 EntityResolver Objects
      • 8.10.4 ErrorHandler Objects
    • 8.11 xml.sax.saxutils -- SAX Utilities
    • image-plus8.12 xml.sax.xmlreader -- Interface for XML parsers
      • 8.12.1 XMLReader Objects
      • 8.12.2 IncrementalParser Objects
      • 8.12.3 Locator Objects
      • 8.12.4 InputSource Objects
      • 8.12.5 The Attributes Interface
      • 8.12.6 The AttributesNS Interface
    • image-plus8.13 xml.etree.ElementTree -- The ElementTree XML API
      • 8.13.1 Functions
      • 8.13.2 ElementTree Objects
      • 8.13.3 QName Objects
      • 8.13.4 TreeBuilder Objects
      • 8.13.5 XMLTreeBuilder Objects
  • image-plus9. File Formats
    • image-plus9.1 csv -- CSV File Reading and Writing
      • 9.1.1 Module Contents
      • 9.1.2 Dialects and Formatting Parameters
      • 9.1.3 Reader Objects
      • 9.1.4 Writer Objects
      • 9.1.5 Examples
    • image-plus9.2 ConfigParser -- Configuration file parser
      • 9.2.1 RawConfigParser Objects
      • 9.2.2 ConfigParser Objects
      • 9.2.3 SafeConfigParser Objects
    • 9.3 robotparser -- Parser for robots.txt
    • image-plus9.4 netrc -- netrc file processing
      • 9.4.1 netrc Objects
    • image-plus9.5 xdrlib -- Encode and decode XDR data
      • 9.5.1 Packer Objects
      • 9.5.2 Unpacker Objects
      • 9.5.3 Exceptions
  • image-plus10. Cryptographic Services
    • 10.1 hashlib -- Secure hashes and message digests
    • 10.2 hmac -- Keyed-Hashing for Message Authentication
    • 10.3 md5 -- MD5 message digest algorithm
    • 10.4 sha -- SHA-1 message digest algorithm
  • image-plus11. File and Directory Access
    • 11.1 os.path -- Common pathname manipulations
    • 11.2 fileinput -- Iterate over lines from multiple input streams
    • 11.3 stat -- Interpreting stat() results
    • 11.4 statvfs -- Constants used with os.statvfs()
    • image-plus11.5 filecmp -- File and Directory Comparisons
      • 11.5.1 The dircmp class
    • 11.6 tempfile -- Generate temporary files and directories
    • 11.7 glob -- Unix style pathname pattern expansion
    • 11.8 fnmatch -- Unix filename pattern matching
    • 11.9 linecache -- Random access to text lines
    • image-plus11.10 shutil -- High-level file operations
      • 11.10.1 Example
    • 11.11 dircache -- Cached directory listings
  • image-plus12. Data Compression and Archiving
    • 12.1 zlib -- Compression compatible with gzip
    • 12.2 gzip -- Support for gzip files
    • image-plus12.3 bz2 -- Compression compatible with bzip2
      • 12.3.1 (De)compression of files
      • 12.3.2 Sequential (de)compression
      • 12.3.3 One-shot (de)compression
    • image-plus12.4 zipfile -- Work with ZIP archives
      • 12.4.1 ZipFile Objects
      • 12.4.2 PyZipFile Objects
      • 12.4.3 ZipInfo Objects
    • image-plus12.5 tarfile -- Read and write tar archive files
      • 12.5.1 TarFile Objects
      • 12.5.2 TarInfo Objects
      • 12.5.3 Examples
  • image-plus13. Data Persistence
    • image-plus13.1 pickle -- Python object serialization
      • 13.1.1 Relationship to other Python modules
      • 13.1.2 Data stream format
      • 13.1.3 Usage
      • 13.1.4 What can be pickled and unpickled?
      • 13.1.5 The pickle protocol
      • 13.1.6 Subclassing Unpicklers
      • 13.1.7 Example
    • 13.2 cPickle -- A faster pickle
    • 13.3 copy_reg -- Register pickle support functions
    • image-plus13.4 shelve -- Python object persistence
      • 13.4.1 Restrictions
      • 13.4.2 Example
    • 13.5 marshal -- Internal Python object serialization
    • 13.6 anydbm -- Generic access to DBM-style databases
    • 13.7 whichdb -- Guess which DBM module created a database
    • 13.8 dbm -- Simple ``database'' interface
    • 13.9 gdbm -- GNU's reinterpretation of dbm
    • image-plus13.10 dbhash -- DBM-style interface to the BSD database library
      • 13.10.1 Database Objects
    • image-plus13.11 bsddb -- Interface to Berkeley DB library
      • 13.11.1 Hash, BTree and Record Objects
    • image-plus13.12 dumbdbm -- Portable DBM implementation
      • 13.12.1 Dumbdbm Objects
    • image-plus13.13 sqlite3 -- DB-API 2.0 interface for SQLite databases
      • 13.13.1 Module functions and constants
      • 13.13.2 Connection Objects
      • 13.13.3 Cursor Objects
      • 13.13.4 SQLite and Python types
      • 13.13.5 Controlling Transactions
      • 13.13.6 Using pysqlite efficiently
  • image-plus14. Generic Operating System Services
    • image-plus14.1 os -- Miscellaneous operating system interfaces
      • 14.1.1 Process Parameters
      • 14.1.2 File Object Creation
      • 14.1.3 File Descriptor Operations
      • 14.1.4 Files and Directories
      • 14.1.5 Process Management
      • 14.1.6 Miscellaneous System Information
      • 14.1.7 Miscellaneous Functions
    • 14.2 time -- Time access and conversions
    • image-plus14.3 optparse -- More powerful command line option parser
      • 14.3.1 Background
      • 14.3.2 Tutorial
      • 14.3.3 Reference Guide
      • 14.3.4 Option Callbacks
      • 14.3.5 Extending optparse
    • 14.4 getopt -- Parser for command line options
    • image-plus14.5 logging -- Logging facility for Python
      • 14.5.1 Logger Objects
      • 14.5.2 Basic example
      • 14.5.3 Logging to multiple destinations
      • 14.5.4 Sending and receiving logging events across a network
      • 14.5.5 Handler Objects
      • 14.5.6 Formatter Objects
      • 14.5.7 Filter Objects
      • 14.5.8 LogRecord Objects
      • 14.5.9 Thread Safety
      • 14.5.10 Configuration
    • 14.6 getpass -- Portable password input
    • image-plus14.7 curses -- Terminal handling for character-cell displays
      • 14.7.1 Functions
      • 14.7.2 Window Objects
      • 14.7.3 Constants
    • image-plus14.8 curses.textpad -- Text input widget for curses programs
      • 14.8.1 Textbox objects
    • 14.9 curses.wrapper -- Terminal handler for curses programs
    • 14.10 curses.ascii -- Utilities for ASCII characters
    • image-plus14.11 curses.panel -- A panel stack extension for curses.
      • 14.11.1 Functions
      • 14.11.2 Panel Objects
    • image-plus14.12 platform -- Access to underlying platform's identifying data.
      • 14.12.1 Cross Platform
      • 14.12.2 Java Platform
      • 14.12.3 Windows Platform
      • 14.12.4 Mac OS Platform
      • 14.12.5 Unix Platforms
    • 14.13 errno -- Standard errno system symbols
    • image-plus14.14 ctypes -- A foreign function library for Python.
      • 14.14.1 ctypes tutorial
      • 14.14.2 ctypes reference
  • image-plus15. Optional Operating System Services
    • image-plus15.1 select -- Waiting for I/O completion
      • 15.1.1 Polling Objects
    • 15.2 thread -- Multiple threads of control
    • image-plus15.3 threading -- Higher-level threading interface
      • 15.3.1 Lock Objects
      • 15.3.2 RLock Objects
      • 15.3.3 Condition Objects
      • 15.3.4 Semaphore Objects
      • 15.3.5 Event Objects
      • 15.3.6 Thread Objects
      • 15.3.7 Timer Objects
      • 15.3.8 Using locks, conditions, and semaphores in the with statement
    • 15.4 dummy_thread -- Drop-in replacement for the thread module
    • 15.5 dummy_threading -- Drop-in replacement for the threading module
    • 15.6 mmap -- Memory-mapped file support
    • image-plus15.7 readline -- GNU readline interface
      • 15.7.1 Example
    • image-plus15.8 rlcompleter -- Completion function for GNU readline
      • 15.8.1 Completer Objects
  • image-plus16. Unix Specific Services
    • image-plus16.1 posix -- The most common POSIX system calls
      • 16.1.1 Large File Support
      • 16.1.2 Module Contents
    • 16.2 pwd -- The password database
    • 16.3 spwd -- The shadow password database
    • 16.4 grp -- The group database
    • 16.5 crypt -- Function to check Unix passwords
    • image-plus16.6 dl -- Call C functions in shared objects
      • 16.6.1 Dl Objects
    • image-plus16.7 termios -- POSIX style tty control
      • 16.7.1 Example
    • 16.8 tty -- Terminal control functions
    • 16.9 pty -- Pseudo-terminal utilities
    • 16.10 fcntl -- The fcntl() and ioctl() system calls
    • image-plus16.11 pipes -- Interface to shell pipelines
      • 16.11.1 Template Objects
    • 16.12 posixfile -- File-like objects with locking support
    • image-plus16.13 resource -- Resource usage information
      • 16.13.1 Resource Limits
      • 16.13.2 Resource Usage
    • 16.14 nis -- Interface to Sun's NIS (Yellow Pages)
    • 16.15 syslog -- Unix syslog library routines
    • 16.16 commands -- Utilities for running commands
  • image-plus17. Interprocess Communication and Networking
    • image-plus17.1 subprocess -- Subprocess management
      • 17.1.1 Using the subprocess Module
      • 17.1.2 Popen Objects
      • 17.1.3 Replacing Older Functions with the subprocess Module
    • image-plus17.2 socket -- Low-level networking interface
      • 17.2.1 Socket Objects
      • 17.2.2 SSL Objects
      • 17.2.3 Example
    • image-plus17.3 signal -- Set handlers for asynchronous events
      • 17.3.1 Example
    • image-plus17.4 popen2 -- Subprocesses with accessible I/O streams
      • 17.4.1 Popen3 and Popen4 Objects
      • 17.4.2 Flow Control Issues
    • image-plus17.5 asyncore -- Asynchronous socket handler
      • 17.5.1 asyncore Example basic HTTP client
    • image-plus17.6 asynchat -- Asynchronous socket command/response handler
      • 17.6.1 asynchat - Auxiliary Classes and Functions
      • 17.6.2 asynchat Example
  • image-plus18. Internet Protocols and Support
    • image-plus18.1 webbrowser -- Convenient Web-browser controller
      • 18.1.1 Browser Controller Objects
    • image-plus18.2 cgi -- Common Gateway Interface support.
      • 18.2.1 Introduction
      • 18.2.2 Using the cgi module
      • 18.2.3 Higher Level Interface
      • 18.2.4 Old classes
      • 18.2.5 Functions
      • 18.2.6 Caring about security
      • 18.2.7 Installing your CGI script on a Unix system
      • 18.2.8 Testing your CGI script
      • 18.2.9 Debugging CGI scripts
      • 18.2.10 Common problems and solutions
    • 18.3 cgitb -- Traceback manager for CGI scripts
    • image-plus18.4 wsgiref -- WSGI Utilities and Reference Implementation
      • 18.4.1 wsgiref.util - WSGI environment utilities
      • 18.4.2 wsgiref.headers - WSGI response header tools
      • 18.4.3 wsgiref.simple_server - a simple WSGI HTTP server
      • 18.4.4 wsgiref.validate - WSGI conformance checker
      • 18.4.5 wsgiref.handlers - server/gateway base classes
    • image-plus18.5 urllib -- Open arbitrary resources by URL
      • 18.5.1 URLopener Objects
      • 18.5.2 Examples
    • image-plus18.6 urllib2 -- extensible library for opening URLs
      • 18.6.1 Request Objects
      • 18.6.2 OpenerDirector Objects
      • 18.6.3 BaseHandler Objects
      • 18.6.4 HTTPRedirectHandler Objects
      • 18.6.5 HTTPCookieProcessor Objects
      • 18.6.6 ProxyHandler Objects
      • 18.6.7 HTTPPasswordMgr Objects
      • 18.6.8 AbstractBasicAuthHandler Objects
      • 18.6.9 HTTPBasicAuthHandler Objects
      • 18.6.10 ProxyBasicAuthHandler Objects
      • 18.6.11 AbstractDigestAuthHandler Objects
      • 18.6.12 HTTPDigestAuthHandler Objects
      • 18.6.13 ProxyDigestAuthHandler Objects
      • 18.6.14 HTTPHandler Objects
      • 18.6.15 HTTPSHandler Objects
      • 18.6.16 FileHandler Objects
      • 18.6.17 FTPHandler Objects
      • 18.6.18 CacheFTPHandler Objects
      • 18.6.19 GopherHandler Objects
      • 18.6.20 UnknownHandler Objects
      • 18.6.21 HTTPErrorProcessor Objects
      • 18.6.22 Examples
    • image-plus18.7 httplib -- HTTP protocol client
      • 18.7.1 HTTPConnection Objects
      • 18.7.2 HTTPResponse Objects
      • 18.7.3 Examples
    • image-plus18.8 ftplib -- FTP protocol client
      • 18.8.1 FTP Objects
    • 18.9 gopherlib -- Gopher protocol client
    • image-plus18.10 poplib -- POP3 protocol client
      • 18.10.1 POP3 Objects
      • 18.10.2 POP3 Example
    • image-plus18.11 imaplib -- IMAP4 protocol client
      • 18.11.1 IMAP4 Objects
      • 18.11.2 IMAP4 Example
    • image-plus18.12 nntplib -- NNTP protocol client
      • 18.12.1 NNTP Objects
    • image-plus18.13 smtplib -- SMTP protocol client
      • 18.13.1 SMTP Objects
      • 18.13.2 SMTP Example
    • image-plus18.14 smtpd -- SMTP Server
      • 18.14.1 SMTPServer Objects
      • 18.14.2 DebuggingServer Objects
      • 18.14.3 PureProxy Objects
      • 18.14.4 MailmanProxy Objects
    • image-plus18.15 telnetlib -- Telnet client
      • 18.15.1 Telnet Objects
      • 18.15.2 Telnet Example
    • image-plus18.16 uuid -- UUID objects according to RFC 4122
      • 18.16.1 Example
    • image-plus18.17 urlparse -- Parse URLs into components
      • 18.17.1 Results of urlparse() and urlsplit()
    • image-plus18.18 SocketServer -- A framework for network servers
      • 18.18.1 Server Creation Notes
      • 18.18.2 Server Objects
      • 18.18.3 RequestHandler Objects
    • 18.19 BaseHTTPServer -- Basic HTTP server
    • 18.20 SimpleHTTPServer -- Simple HTTP request handler
    • 18.21 CGIHTTPServer -- CGI-capable HTTP request handler
    • image-plus18.22 cookielib -- Cookie handling for HTTP clients
      • 18.22.1 CookieJar and FileCookieJar Objects
      • 18.22.2 FileCookieJar subclasses and co-operation with web browsers
      • 18.22.3 CookiePolicy Objects
      • 18.22.4 DefaultCookiePolicy Objects
      • 18.22.5 Cookie Objects
      • 18.22.6 Examples
    • image-plus18.23 Cookie -- HTTP state management
      • 18.23.1 Cookie Objects
      • 18.23.2 Morsel Objects
      • 18.23.3 Example
    • image-plus18.24 xmlrpclib -- XML-RPC client access
      • 18.24.1 ServerProxy Objects
      • 18.24.2 Boolean Objects
      • 18.24.3 DateTime Objects
      • 18.24.4 Binary Objects
      • 18.24.5 Fault Objects
      • 18.24.6 ProtocolError Objects
      • 18.24.7 MultiCall Objects
      • 18.24.8 Convenience Functions
      • 18.24.9 Example of Client Usage
    • image-plus18.25 SimpleXMLRPCServer -- Basic XML-RPC server
      • 18.25.1 SimpleXMLRPCServer Objects
      • 18.25.2 CGIXMLRPCRequestHandler
    • image-plus18.26 DocXMLRPCServer -- Self-documenting XML-RPC server
      • 18.26.1 DocXMLRPCServer Objects
      • 18.26.2 DocCGIXMLRPCRequestHandler
  • image-plus19. Multimedia Services
    • 19.1 audioop -- Manipulate raw audio data
    • 19.2 imageop -- Manipulate raw image data
    • 19.3 aifc -- Read and write AIFF and AIFC files
    • image-plus19.4 sunau -- Read and write Sun AU files
      • 19.4.1 AU_read Objects
      • 19.4.2 AU_write Objects
    • image-plus19.5 wave -- Read and write WAV files
      • 19.5.1 Wave_read Objects
      • 19.5.2 Wave_write Objects
    • 19.6 chunk -- Read IFF chunked data
    • 19.7 colorsys -- Conversions between color systems
    • 19.8 rgbimg -- Read and write ``SGI RGB'' files
    • 19.9 imghdr -- Determine the type of an image
    • 19.10 sndhdr -- Determine type of sound file
    • image-plus19.11 ossaudiodev -- Access to OSS-compatible audio devices
      • 19.11.1 Audio Device Objects
      • 19.11.2 Mixer Device Objects
  • image-plus20. Graphical User Interfaces with Tk
    • image-plus20.1 Tkinter -- Python interface to Tcl/Tk
      • 20.1.1 Tkinter Modules
      • 20.1.2 Tkinter Life Preserver
      • 20.1.3 A (Very) Quick Look at Tcl/Tk
      • 20.1.4 Mapping Basic Tk into Tkinter
      • 20.1.5 How Tk and Tkinter are Related
      • 20.1.6 Handy Reference
    • image-plus20.2 Tix -- Extension widgets for Tk
      • 20.2.1 Using Tix
      • 20.2.2 Tix Widgets
      • 20.2.3 Tix Commands
    • 20.3 ScrolledText -- Scrolled Text Widget
    • image-plus20.4 turtle -- Turtle graphics for Tk
      • 20.4.1 Turtle, Pen and RawPen Objects
    • image-plus20.5 Idle
      • 20.5.1 Menus
      • 20.5.2 Basic editing and navigation
      • 20.5.3 Syntax colors
    • 20.6 Other Graphical User Interface Packages
  • image-plus21. Internationalization
    • image-plus21.1 gettext -- Multilingual internationalization services
      • 21.1.1 GNU gettext API
      • 21.1.2 Class-based API
      • 21.1.3 Internationalizing your programs and modules
      • 21.1.4 Acknowledgements
    • image-plus21.2 locale -- Internationalization services
      • 21.2.1 Background, details, hints, tips and caveats
      • 21.2.2 For extension writers and programs that embed Python
      • 21.2.3 Access to message catalogs
  • image-plus22. Program Frameworks
    • image-plus22.1 cmd -- Support for line-oriented command interpreters
      • 22.1.1 Cmd Objects
    • image-plus22.2 shlex -- Simple lexical analysis
      • 22.2.1 shlex Objects
      • 22.2.2 Parsing Rules
  • image-plus23. Development Tools
    • 23.1 pydoc -- Documentation generator and online help system
    • image-plus23.2 doctest -- Test interactive Python examples
      • 23.2.1 Simple Usage: Checking Examples in Docstrings
      • 23.2.2 Simple Usage: Checking Examples in a Text File
      • 23.2.3 How It Works
      • 23.2.4 Basic API
      • 23.2.5 Unittest API
      • 23.2.6 Advanced API
      • 23.2.7 Debugging
      • 23.2.8 Soapbox
    • image-plus23.3 unittest -- Unit testing framework
      • 23.3.1 Basic example
      • 23.3.2 Organizing test code
      • 23.3.3 Re-using old test code
      • 23.3.4 Classes and functions
      • 23.3.5 TestCase Objects
      • 23.3.6 TestSuite Objects
      • 23.3.7 TestResult Objects
      • 23.3.8 TestLoader Objects
    • image-plus23.4 test -- Regression tests package for Python
      • 23.4.1 Writing Unit Tests for the test package
      • 23.4.2 Running tests using test.regrtest
    • 23.5 test.test_support -- Utility functions for tests
  • image-plus24. The Python Debugger
    • 24.1 Debugger Commands
    • 24.2 How It Works
  • image-plus25. The Python Profilers
    • 25.1 Introduction to the profilers
    • 25.2 Instant User's Manual
    • 25.3 What Is Deterministic Profiling?
    • image-plus25.4 Reference Manual - profile and cProfile
      • 25.4.1 The Stats Class
    • 25.5 Limitations
    • 25.6 Calibration
    • 25.7 Extensions -- Deriving Better Profilers
    • image-plus25.8 hotshot -- High performance logging profiler
      • 25.8.1 Profile Objects
      • 25.8.2 Using hotshot data
      • 25.8.3 Example Usage
    • image-plus25.9 timeit -- Measure execution time of small code snippets
      • 25.9.1 Command Line Interface
      • 25.9.2 Examples
    • image-plus25.10 trace -- Trace or track Python statement execution
      • 25.10.1 Command Line Usage
      • 25.10.2 Programming Interface
  • image-plus26. Python Runtime Services
    • 26.1 sys -- System-specific parameters and functions
    • 26.2 __builtin__ -- Built-in objects
    • 26.3 __main__ -- Top-level script environment
    • image-plus26.4 warnings -- Warning control
      • 26.4.1 Warning Categories
      • 26.4.2 The Warnings Filter
      • 26.4.3 Available Functions
    • 26.5 contextlib -- Utilities for with-statement contexts.
    • image-plus26.6 atexit -- Exit handlers
      • 26.6.1 atexit Example
    • image-plus26.7 traceback -- Print or retrieve a stack traceback
      • 26.7.1 Traceback Example
    • 26.8 __future__ -- Future statement definitions
    • 26.9 gc -- Garbage Collector interface
    • image-plus26.10 inspect -- Inspect live objects
      • 26.10.1 Types and members
      • 26.10.2 Retrieving source code
      • 26.10.3 Classes and functions
      • 26.10.4 The interpreter stack
    • 26.11 site -- Site-specific configuration hook
    • 26.12 user -- User-specific configuration hook
    • image-plus26.13 fpectl -- Floating point exception control
      • 26.13.1 Example
      • 26.13.2 Limitations and other considerations
  • image-plus27. Custom Python Interpreters
    • image-plus27.1 code -- Interpreter base classes
      • 27.1.1 Interactive Interpreter Objects
      • 27.1.2 Interactive Console Objects
    • 27.2 codeop -- Compile Python code
  • image-plus28. Restricted Execution
    • image-plus28.1 rexec -- Restricted execution framework
      • 28.1.1 RExec Objects
      • 28.1.2 Defining restricted environments
      • 28.1.3 An example
    • 28.2 Bastion -- Restricting access to objects
  • image-plus29. Importing Modules
    • image-plus29.1 imp -- Access the import internals
      • 29.1.1 Examples
    • image-plus29.2 zipimport -- Import modules from Zip archives
      • 29.2.1 zipimporter Objects
      • 29.2.2 Examples
    • 29.3 pkgutil -- Package extension utility
    • 29.4 modulefinder -- Find modules used by a script
    • 29.5 runpy -- Locating and executing Python modules.
  • image-plus30. Python Language Services
    • image-plus30.1 parser -- Access Python parse trees
      • 30.1.1 Creating AST Objects
      • 30.1.2 Converting AST Objects
      • 30.1.3 Queries on AST Objects
      • 30.1.4 Exceptions and Error Handling
      • 30.1.5 AST Objects
      • 30.1.6 Examples
    • 30.2 symbol -- Constants used with Python parse trees
    • 30.3 token -- Constants used with Python parse trees
    • 30.4 keyword -- Testing for Python keywords
    • 30.5 tokenize -- Tokenizer for Python source
    • 30.6 tabnanny -- Detection of ambiguous indentation
    • image-plus30.7 pyclbr -- Python class browser support
      • 30.7.1 Class Descriptor Objects
      • 30.7.2 Function Descriptor Objects
    • 30.8 py_compile -- Compile Python source files
    • 30.9 compileall -- Byte-compile Python libraries
    • image-plus30.10 dis -- Disassembler for Python byte code
      • 30.10.1 Python Byte Code Instructions
    • 30.11 pickletools -- Tools for pickle developers.
    • 30.12 distutils -- Building and installing Python modules
  • image-plus31. Python compiler package
    • 31.1 The basic interface
    • 31.2 Limitations
    • image-plus31.3 Python Abstract Syntax
      • 31.3.1 AST Nodes
      • 31.3.2 Assignment nodes
      • 31.3.3 Examples
    • 31.4 Using Visitors to Walk ASTs
    • 31.5 Bytecode Generation
  • image-plus32. Abstract Syntax Trees
    • 32.1 Abstract Grammar
  • image-plus33. Miscellaneous Services
    • image-plus33.1 formatter -- Generic output formatting
      • 33.1.1 The Formatter Interface
      • 33.1.2 Formatter Implementations
      • 33.1.3 The Writer Interface
      • 33.1.4 Writer Implementations
  • image-plus34. SGI IRIX Specific Services
    • image-plus34.1 al -- Audio functions on the SGI
      • 34.1.1 Configuration Objects
      • 34.1.2 Port Objects
    • 34.2 AL -- Constants used with the al module
    • image-plus34.3 cd -- CD-ROM access on SGI systems
      • 34.3.1 Player Objects
      • 34.3.2 Parser Objects
    • image-plus34.4 fl -- FORMS library for graphical user interfaces
      • 34.4.1 Functions Defined in Module fl
      • 34.4.2 Form Objects
      • 34.4.3 FORMS Objects
    • 34.5 FL -- Constants used with the fl module
    • 34.6 flp -- Functions for loading stored FORMS designs
    • 34.7 fm -- Font Manager interface
    • 34.8 gl -- Graphics Library interface
    • 34.9 DEVICE -- Constants used with the gl module
    • 34.10 GL -- Constants used with the gl module
    • 34.11 imgfile -- Support for SGI imglib files
    • 34.12 jpeg -- Read and write JPEG files
  • image-plus35. SunOS Specific Services
    • image-plus35.1 sunaudiodev -- Access to Sun audio hardware
      • 35.1.1 Audio Device Objects
    • 35.2 SUNAUDIODEV -- Constants used with sunaudiodev
  • image-plus36. MS Windows Specific Services
    • image-plus36.1 msilib -- Read and write Microsoft Installer files
      • 36.1.1 Database Objects
      • 36.1.2 View Objects
      • 36.1.3 Summary Information Objects
      • 36.1.4 Record Objects
      • 36.1.5 Errors
      • 36.1.6 CAB Objects
      • 36.1.7 Directory Objects
      • 36.1.8 Features
      • 36.1.9 GUI classes
      • 36.1.10 Precomputed tables
    • image-plus36.2 msvcrt - Useful routines from the MS VC++ runtime
      • 36.2.1 File Operations
      • 36.2.2 Console I/O
      • 36.2.3 Other Functions
    • image-plus36.3 _winreg - Windows registry access
      • 36.3.1 Registry Handle Objects
    • 36.4 winsound -- Sound-playing interface for Windows
  • image-plusA. Undocumented Modules
    • A.1 Frameworks
    • A.2 Miscellaneous useful utilities
    • A.3 Platform specific modules
    • A.4 Multimedia
    • A.5 Obsolete
    • A.6 SGI-specific Extension modules
  • B. Reporting Bugs
  • image-plusC. History and License
    • C.1 History of the software
    • C.2 Terms and conditions for accessing or otherwise using Python
    • image-plusC.3 Licenses and Acknowledgements for Incorporated Software
      • C.3.1 Mersenne Twister
      • C.3.2 Sockets
      • C.3.3 Floating point exception control
      • C.3.4 MD5 message digest algorithm
      • C.3.5 Asynchronous socket services
      • C.3.6 Cookie management
      • C.3.7 Profiling
      • C.3.8 Execution tracing
      • C.3.9 UUencode and UUdecode functions
      • C.3.10 XML Remote Procedure Calls
  • Module Index
  • Index
  • About this document ...
  • Front Matter
  • Contents
  • image-plus1. Introduction
    • 1.1 Include Files
    • image-plus1.2 Objects, Types and Reference Counts
      • 1.2.1 Reference Counts
      • 1.2.2 Types
    • 1.3 Exceptions
    • 1.4 Embedding Python
    • 1.5 Debugging Builds
  • 2. The Very High Level Layer
  • 3. Reference Counting
  • image-plus4. Exception Handling
    • 4.1 Standard Exceptions
    • 4.2 Deprecation of String Exceptions
  • image-plus5. Utilities
    • 5.1 Operating System Utilities
    • 5.2 Process Control
    • 5.3 Importing Modules
    • 5.4 Data marshalling support
    • 5.5 Parsing arguments and building values
    • 5.6 String conversion and formatting
  • image-plus6. Abstract Objects Layer
    • 6.1 Object Protocol
    • 6.2 Number Protocol
    • 6.3 Sequence Protocol
    • 6.4 Mapping Protocol
    • 6.5 Iterator Protocol
    • 6.6 Buffer Protocol
  • image-plus7. Concrete Objects Layer
    • image-plus7.1 Fundamental Objects
      • 7.1.1 Type Objects
      • 7.1.2 The None Object
    • image-plus7.2 Numeric Objects
      • 7.2.1 Plain Integer Objects
      • 7.2.2 Boolean Objects
      • 7.2.3 Long Integer Objects
      • 7.2.4 Floating Point Objects
      • 7.2.5 Complex Number Objects
    • image-plus7.3 Sequence Objects
      • 7.3.1 String Objects
      • 7.3.2 Unicode Objects
      • 7.3.3 Buffer Objects
      • 7.3.4 Tuple Objects
      • 7.3.5 List Objects
    • image-plus7.4 Mapping Objects
      • 7.4.1 Dictionary Objects
    • image-plus7.5 Other Objects
      • 7.5.1 File Objects
      • 7.5.2 Instance Objects
      • 7.5.3 Function Objects
      • 7.5.4 Method Objects
      • 7.5.5 Module Objects
      • 7.5.6 Iterator Objects
      • 7.5.7 Descriptor Objects
      • 7.5.8 Slice Objects
      • 7.5.9 Weak Reference Objects
      • 7.5.10 CObjects
      • 7.5.11 Cell Objects
      • 7.5.12 Generator Objects
      • 7.5.13 DateTime Objects
      • 7.5.14 Set Objects
  • image-plus8. Initialization, Finalization, and Threads
    • 8.1 Thread State and the Global Interpreter Lock
    • 8.2 Profiling and Tracing
    • 8.3 Advanced Debugger Support
  • image-plus9. Memory Management
    • 9.1 Overview
    • 9.2 Memory Interface
    • 9.3 Examples
  • image-plus10. Object Implementation Support
    • 10.1 Allocating Objects on the Heap
    • 10.2 Common Object Structures
    • 10.3 Type Objects
    • 10.4 Mapping Object Structures
    • 10.5 Number Object Structures
    • 10.6 Sequence Object Structures
    • 10.7 Buffer Object Structures
    • 10.8 Supporting the Iterator Protocol
    • 10.9 Supporting Cyclic Garbage Collection
  • A. Reporting Bugs
  • image-plusB. History and License
    • B.1 History of the software
    • B.2 Terms and conditions for accessing or otherwise using Python
    • image-plusB.3 Licenses and Acknowledgements for Incorporated Software
      • B.3.1 Mersenne Twister
      • B.3.2 Sockets
      • B.3.3 Floating point exception control
      • B.3.4 MD5 message digest algorithm
      • B.3.5 Asynchronous socket services
      • B.3.6 Cookie management
      • B.3.7 Profiling
      • B.3.8 Execution tracing
      • B.3.9 UUencode and UUdecode functions
      • B.3.10 XML Remote Procedure Calls
  • Index
  • About this document ...
  • Front Matter
  • Contents
  • image-plus1. Extending Python with C or C++
    • 1.1 A Simple Example
    • 1.2 Intermezzo: Errors and Exceptions
    • 1.3 Back to the Example
    • 1.4 The Module's Method Table and Initialization Function
    • 1.5 Compilation and Linkage
    • 1.6 Calling Python Functions from C
    • 1.7 Extracting Parameters in Extension Functions
    • 1.8 Keyword Parameters for Extension Functions
    • 1.9 Building Arbitrary Values
    • image-plus1.10 Reference Counts
      • 1.10.1 Reference Counting in Python
      • 1.10.2 Ownership Rules
      • 1.10.3 Thin Ice
      • 1.10.4 NULL Pointers
    • 1.11 Writing Extensions in C++
    • 1.12 Providing a C API for an Extension Module
  • image-plus2. Defining New Types
    • image-plus2.1 The Basics
      • 2.1.1 Adding data and methods to the Basic example
      • 2.1.2 Providing finer control over data attributes
      • 2.1.3 Supporting cyclic garbage collection
      • 2.1.4 Subclassing other types
    • image-plus2.2 Type Methods
      • 2.2.1 Finalization and De-allocation
      • 2.2.2 Object Presentation
      • 2.2.3 Attribute Management
      • 2.2.4 Object Comparison
      • 2.2.5 Abstract Protocol Support
      • 2.2.6 Weak Reference Support
      • 2.2.7 More Suggestions
  • image-plus3. Building C and C++ Extensions with distutils
    • 3.1 Distributing your extension modules
  • image-plus4. Building C and C++ Extensions on Windows
    • 4.1 A Cookbook Approach
    • 4.2 Differences Between Unix and Windows
    • 4.3 Using DLLs in Practice
  • image-plus5. Embedding Python in Another Application
    • 5.1 Very High Level Embedding
    • 5.2 Beyond Very High Level Embedding: An overview
    • 5.3 Pure Embedding
    • 5.4 Extending Embedded Python
    • 5.5 Embedding Python in C++
    • 5.6 Linking Requirements
  • A. Reporting Bugs
  • image-plusB. History and License
    • B.1 History of the software
    • B.2 Terms and conditions for accessing or otherwise using Python
    • image-plusB.3 Licenses and Acknowledgements for Incorporated Software
      • B.3.1 Mersenne Twister
      • B.3.2 Sockets
      • B.3.3 Floating point exception control
      • B.3.4 MD5 message digest algorithm
      • B.3.5 Asynchronous socket services
      • B.3.6 Cookie management
      • B.3.7 Profiling
      • B.3.8 Execution tracing
      • B.3.9 UUencode and UUdecode functions
      • B.3.10 XML Remote Procedure Calls
  • About this document ...
  • __builtin__
  • __future__
  • __main__
  • _winreg (Windows)
  • aepack (Mac)
  • aetools (Mac)
  • aetypes (Mac)
  • aifc
  • AL (IRIX)
  • al (IRIX)
  • anydbm
  • applesingle (Mac)
  • array
  • asynchat
  • asyncore
  • atexit
  • audioop
  • autoGIL (Mac)
  • base64
  • BaseHTTPServer
  • Bastion
  • binascii
  • binhex
  • bisect
  • bsddb
  • buildtools (Mac)
  • bz2
  • calendar
  • Carbon.AE (Mac)
  • Carbon.AH (Mac)
  • Carbon.App (Mac)
  • Carbon.CarbonEvt (Mac)
  • Carbon.CF (Mac)
  • Carbon.CG (Mac)
  • Carbon.Cm (Mac)
  • Carbon.Ctl (Mac)
  • Carbon.Dlg (Mac)
  • Carbon.Evt (Mac)
  • Carbon.Fm (Mac)
  • Carbon.Folder (Mac)
  • Carbon.Help (Mac)
  • Carbon.List (Mac)
  • Carbon.Menu (Mac)
  • Carbon.Mlte (Mac)
  • Carbon.Qd (Mac)
  • Carbon.Qdoffs (Mac)
  • Carbon.Qt (Mac)
  • Carbon.Res (Mac)
  • Carbon.Scrap (Mac)
  • Carbon.Snd (Mac)
  • Carbon.TE (Mac)
  • Carbon.Win (Mac)
  • cd (IRIX)
  • cfmfile (Mac)
  • cgi
  • CGIHTTPServer
  • cgitb
  • chunk
  • cmath
  • cmd
  • code
  • codecs
  • codeop
  • collections
  • ColorPicker (Mac)
  • colorsys
  • commands (Unix)
  • compileall
  • compiler
  • compiler.ast
  • compiler.visitor
  • ConfigParser
  • contextlib
  • Cookie
  • cookielib
  • copy
  • copy_reg
  • cPickle
  • cProfile
  • crypt (Unix)
  • cStringIO
  • csv
  • ctypes
  • curses
  • curses.ascii
  • curses.panel
  • curses.textpad
  • curses.wrapper
  • datetime
  • dbhash
  • dbm (Unix)
  • decimal
  • DEVICE (IRIX)
  • difflib
  • dircache
  • dis
  • distutils
  • distutils.archive_util
  • distutils.bcppcompiler
  • distutils.ccompiler
  • distutils.cmd
  • distutils.command
  • distutils.command.bdist
  • distutils.command.bdist_dumb
  • distutils.command.bdist_msi
  • distutils.command.bdist_packager
  • distutils.command.bdist_rpm
  • distutils.command.bdist_wininst
  • distutils.command.build
  • distutils.command.build_clib
  • distutils.command.build_ext
  • distutils.command.build_py
  • distutils.command.build_scripts
  • distutils.command.clean
  • distutils.command.config
  • distutils.command.install
  • distutils.command.install_data
  • distutils.command.install_headers
  • distutils.command.install_lib
  • distutils.command.install_scripts
  • distutils.command.register
  • distutils.command.sdist
  • distutils.core
  • distutils.cygwinccompiler
  • distutils.debug
  • distutils.dep_util
  • distutils.dir_util
  • distutils.dist
  • distutils.emxccompiler
  • distutils.errors
  • distutils.extension
  • distutils.fancy_getopt
  • distutils.file_util
  • distutils.filelist
  • distutils.log
  • distutils.msvccompiler
  • distutils.mwerkscompiler
  • distutils.spawn
  • distutils.sysconfig
  • distutils.text_file
  • distutils.unixccompiler
  • distutils.util
  • distutils.version
  • dl (Unix)
  • doctest
  • DocXMLRPCServer
  • dumbdbm
  • dummy_thread
  • dummy_threading
  • EasyDialogs (Mac)
  • email
  • email.charset
  • email.encoders
  • email.errors
  • email.generator
  • email.header
  • email.iterators
  • email.message
  • email.mime
  • email.mime.audio
  • email.mime.base
  • email.mime.image
  • email.mime.message
  • email.mime.multipart
  • email.mime.nonmultipart
  • email.mime.text
  • email.parser
  • email.utils
  • encodings.idna
  • errno
  • exceptions
  • fcntl (Unix)
  • filecmp
  • fileinput
  • findertools (Mac)
  • FL (IRIX)
  • fl (IRIX)
  • flp (IRIX)
  • fm (IRIX)
  • fnmatch
  • formatter
  • fpectl (Unix)
  • fpformat
  • FrameWork (Mac)
  • ftplib
  • functools
  • gc
  • gdbm (Unix)
  • gensuitemodule (Mac)
  • getopt
  • getpass
  • gettext
  • GL (IRIX)
  • gl (IRIX)
  • glob
  • gopherlib
  • grp (Unix)
  • gzip
  • hashlib
  • heapq
  • hmac
  • hotshot
  • hotshot.stats
  • htmlentitydefs
  • htmllib
  • HTMLParser
  • httplib
  • ic (Mac)
  • icopen (Mac)
  • imageop
  • imaplib
  • imgfile (IRIX)
  • imghdr
  • imp
  • inspect
  • itertools
  • jpeg (IRIX)
  • keyword
  • linecache
  • locale
  • logging
  • macerrors (Mac)
  • macfs (Mac)
  • MacOS (Mac)
  • macostools (Mac)
  • macpath
  • macresource (Mac)
  • mailbox
  • mailcap
  • marshal
  • math
  • md5
  • mhlib
  • mimetools
  • mimetypes
  • MimeWriter
  • mimify
  • MiniAEFrame (Mac)
  • mmap
  • modulefinder
  • msilib (Windows)
  • msvcrt (Windows)
  • multifile
  • mutex
  • Nav (Mac)
  • netrc
  • new
  • nis (UNIX)
  • nntplib
  • operator
  • optparse
  • os
  • os.path
  • ossaudiodev (Linux, FreeBSD)
  • parser
  • pdb
  • pickle
  • pickletools
  • pipes (Unix)
  • PixMapWrapper (Mac)
  • pkgutil
  • platform
  • popen2
  • poplib
  • posix (Unix)
  • posixfile (Unix)
  • pprint
  • profile
  • pstats
  • pty (IRIX, Linux)
  • pwd (Unix)
  • py_compile
  • pyclbr
  • pydoc
  • Queue
  • quopri
  • random
  • re
  • readline (Unix)
  • repr
  • resource (Unix)
  • rexec
  • rfc822
  • rgbimg
  • rlcompleter
  • robotparser
  • runpy
  • sched
  • ScrolledText (Tk)
  • select
  • sets
  • sgmllib
  • sha
  • shelve
  • shlex
  • shutil
  • signal
  • SimpleHTTPServer
  • SimpleXMLRPCServer
  • site
  • smtpd
  • smtplib
  • sndhdr
  • socket
  • SocketServer
  • spwd (Unix)
  • sqlite3
  • stat
  • statvfs
  • string
  • StringIO
  • stringprep
  • struct
  • subprocess
  • sunau
  • SUNAUDIODEV (SunOS)
  • sunaudiodev (SunOS)
  • symbol
  • sys
  • syslog (Unix)
  • tabnanny
  • tarfile
  • telnetlib
  • tempfile
  • termios (Unix)
  • test
  • test.test_support
  • textwrap
  • thread
  • threading
  • time
  • timeit
  • Tix
  • Tkinter
  • token
  • tokenize
  • trace
  • traceback
  • tty (Unix)
  • turtle (Tk)
  • types
  • unicodedata
  • unittest
  • urllib
  • urllib2
  • urlparse
  • user
  • UserDict
  • UserList
  • UserString
  • uu
  • uuid
  • videoreader (Mac)
  • W (Mac)
  • warnings
  • wave
  • weakref
  • webbrowser
  • whichdb
  • winsound (Windows)
  • wsgiref
  • wsgiref.handlers
  • wsgiref.headers
  • wsgiref.simple_server
  • wsgiref.util
  • wsgiref.validate
  • xdrlib
  • xml.dom
  • xml.dom.minidom
  • xml.dom.pulldom
  • xml.etree.ElementTree
  • xml.parsers.expat
  • xml.sax
  • xml.sax.handler
  • xml.sax.saxutils
  • xml.sax.xmlreader
  • xmlrpclib
  • zipfile
  • zipimport
  • zlib

Website

PEPs

Newsgroups

Advanced search

Package index

Browse the tree of packages

Issue tracker

  • A