To see an alphabetical site map click here

  • Contents
    Python/C API Reference Manual Previous: Front Matter Up: Python/C API Reference Manual Next: 1. Introduction Contents 1. Introduction 1.1 Include Files 1.2 Objects, Types and Reference Counts 1.2.1...

  • Acknowledgements
    Acknowledgements

  • Python 2.5 Documentation - 19th September, 2006
    Top-level index to the standard documentation for Python 2.5.

  • Global Module Index
    Global Module Index

  • 6. Abstract Objects Layer
    Python/C API Reference Manual Previous: 5.5 Parsing arguments and Up: Python/C API Reference Manual Next: 6.1 Object Protocol 6. Abstract Objects Layer The functions in this chapter interact with...

  • 6.6 Buffer Protocol
    Python/C API Reference Manual Previous: 6.5 Iterator Protocol Up: 6. Abstract Objects Layer Next: 7. Concrete Objects Layer 6.6 Buffer Protocol int  PyObject_AsCharBuffer ( PyObject * obj ,...

  • 8.3 Advanced Debugger Support
    Python/C API Reference Manual Previous: 8.2 Profiling and Tracing Up: 8. Initialization, Finalization, and Next: 9. Memory Management 8.3 Advanced Debugger Support These functions are only intended...

  • 10.1 Allocating Objects on the Heap
    Python/C API Reference Manual Previous: 10. Object Implementation Support Up: 10. Object Implementation Support Next: 10.2 Common Object Structures 10.1 Allocating Objects on the Heap PyObject* ...

  • Python/C API Reference Manual
    Python/C API Reference Manual Up: Python Documentation Index Next: Front Matter Python/C API Reference Manual Guido van Rossum Python Software Foundation Email: docs@python.org Fred L. Drake, Jr.,...

  • 5.5 Parsing arguments and building values
    Python/C API Reference Manual Previous: 5.4 Data marshalling support Up: 5. Utilities Next: 6. Abstract Objects Layer 5.5 Parsing arguments and building values These functions are useful when...

  • 7.2.2 Boolean Objects
    Python/C API Reference Manual Previous: 7.2.1 Plain Integer Objects Up: 7.2 Numeric Objects Next: 7.2.3 Long Integer Objects 7.2.2 Boolean Objects Booleans in Python are implemented as a subclass of...

  • 7.3.3 Buffer Objects
    Python/C API Reference Manual Previous: 7.3.2.2 Methods and Slot Up: 7.3 Sequence Objects Next: 7.3.4 Tuple Objects 7.3.3 Buffer Objects Python objects implemented in C can export a group of...

  • 10.7 Buffer Object Structures
    Python/C API Reference Manual Previous: 10.6 Sequence Object Structures Up: 10. Object Implementation Support Next: 10.8 Supporting the Iterator 10.7 Buffer Object Structures The buffer interface...

  • About the Python Documentation
    Overview information about the Python documentation

  • 7.5.11 Cell Objects
    Python/C API Reference Manual Previous: 7.5.10 CObjects Up: 7.5 Other Objects Next: 7.5.12 Generator Objects 7.5.11 Cell Objects ``Cell'' objects are used to implement variables referenced by...

  • 7.5.10 CObjects
    Python/C API Reference Manual Previous: 7.5.9 Weak Reference Objects Up: 7.5 Other Objects Next: 7.5.11 Cell Objects 7.5.10 CObjects Refer to Extending and Embedding the Python Interpreter ,...

  • 10.2 Common Object Structures
    Python/C API Reference Manual Previous: 10.1 Allocating Objects on Up: 10. Object Implementation Support Next: 10.3 Type Objects 10.2 Common Object Structures There are a large number of structures...

  • 7.2.5 Complex Number Objects
    Python/C API Reference Manual Previous: 7.2.4 Floating Point Objects Up: 7.2 Numeric Objects Next: 7.2.5.1 Complex Numbers as 7.2.5 Complex Number Objects Python's complex number objects are...

  • 7. Concrete Objects Layer
    Python/C API Reference Manual Previous: 6.6 Buffer Protocol Up: Python/C API Reference Manual Next: 7.1 Fundamental Objects 7. Concrete Objects Layer The functions in this chapter are specific to...

  • Index
    Python/C API Reference Manual Previous: B.3.10 XML Remote Procedure Up: Python/C API Reference Manual Next: About this document ... Index _ | a | b | c | d | e | f | g | h | i | k | l | m | n | o | p...

  • 3. Reference Counting
    Python/C API Reference Manual Previous: 2. The Very High Up: Python/C API Reference Manual Next: 4. Exception Handling 3. Reference Counting The macros in this section are used for managing reference...

  • 7.5.13 DateTime Objects
    Python/C API Reference Manual Previous: 7.5.12 Generator Objects Up: 7.5 Other Objects Next: 7.5.14 Set Objects 7.5.13 DateTime Objects Various date and time objects are supplied by the datetime...

  • 1.5 Debugging Builds
    Python/C API Reference Manual Previous: 1.4 Embedding Python Up: 1. Introduction Next: 2. The Very High 1.5 Debugging Builds Python can be built with several macros to enable extra checks of the...

  • 7.5.7 Descriptor Objects
    Python/C API Reference Manual Previous: 7.5.6 Iterator Objects Up: 7.5 Other Objects Next: 7.5.8 Slice Objects 7.5.7 Descriptor Objects ``Descriptors'' are objects that describe some attribute of an...

  • 7.4.1 Dictionary Objects
    Python/C API Reference Manual Previous: 7.4 Mapping Objects Up: 7.4 Mapping Objects Next: 7.5 Other Objects 7.4.1 Dictionary Objects PyDictObject This subtype of PyObject represents a Python...

  • 1.4 Embedding Python
    Python/C API Reference Manual Previous: 1.3 Exceptions Up: 1. Introduction Next: 1.5 Debugging Builds 1.4 Embedding Python The one important task that only embedders (as opposed to extension writers)...

  • 4. Exception Handling
    Python/C API Reference Manual Previous: 3. Reference Counting Up: Python/C API Reference Manual Next: 4.1 Standard Exceptions 4. Exception Handling The functions described in this chapter will let...

  • 1.3 Exceptions
    Python/C API Reference Manual Previous: 1.2.2 Types Up: 1. Introduction Next: 1.4 Embedding Python 1.3 Exceptions The Python programmer only needs to deal with exceptions if specific error handling...

  • 7.5.1 File Objects
    Python/C API Reference Manual Previous: 7.5 Other Objects Up: 7.5 Other Objects Next: 7.5.2 Instance Objects 7.5.1 File Objects Python's built-in file objects are implemented entirely on the FILE*...

  • 7.2.4 Floating Point Objects
    Python/C API Reference Manual Previous: 7.2.3 Long Integer Objects Up: 7.2 Numeric Objects Next: 7.2.5 Complex Number Objects 7.2.4 Floating Point Objects PyFloatObject This subtype of PyObject...

  • Front Matter
    Python/C API Reference Manual Previous: Python/C API Reference Manual Up: Python/C API Reference Manual Next: Contents Front Matter Copyright © 2001-2006 Python Software Foundation. All rights...

  • 7.5.3 Function Objects
    Python/C API Reference Manual Previous: 7.5.2 Instance Objects Up: 7.5 Other Objects Next: 7.5.4 Method Objects 7.5.3 Function Objects There are a few functions specific to Python functions....

  • 7.1 Fundamental Objects
    Python/C API Reference Manual Previous: 7. Concrete Objects Layer Up: 7. Concrete Objects Layer Next: 7.1.1 Type Objects 7.1 Fundamental Objects This section describes Python type objects and the...

  • 7.3.2.1 Built-in Codecs
    Python/C API Reference Manual Previous: 7.3.2 Unicode Objects Up: 7.3.2 Unicode Objects Next: 7.3.2.2 Methods and Slot 7.3.2.1 Built-in Codecs Python provides a set of builtin codecs which are...

  • 7.5.12 Generator Objects
    Python/C API Reference Manual Previous: 7.5.11 Cell Objects Up: 7.5 Other Objects Next: 7.5.13 DateTime Objects 7.5.12 Generator Objects Generator objects are what Python uses to implement generator...

  • 5.3 Importing Modules
    Python/C API Reference Manual Previous: 5.2 Process Control Up: 5. Utilities Next: 5.4 Data marshalling support 5.3 Importing Modules PyObject*  PyImport_ImportModule ( const char * name )...

  • 1.1 Include Files
    Python/C API Reference Manual Previous: 1. Introduction Up: 1. Introduction Next: 1.2 Objects, Types and 1.1 Include Files All function, type and macro definitions needed to use the Python/C API are...

  • 8. Initialization, Finalization, and Threads
    Python/C API Reference Manual Previous: 7.5.14 Set Objects Up: Python/C API Reference Manual Next: 8.1 Thread State and 8. Initialization, Finalization, and Threads void  Py_Initialize ( )...

  • 7.5.2 Instance Objects
    Python/C API Reference Manual Previous: 7.5.1 File Objects Up: 7.5 Other Objects Next: 7.5.3 Function Objects 7.5.2 Instance Objects There are very few functions specific to instance objects....

  • 7.2.1 Plain Integer Objects
    Python/C API Reference Manual Previous: 7.2 Numeric Objects Up: 7.2 Numeric Objects Next: 7.2.2 Boolean Objects 7.2.1 Plain Integer Objects PyIntObject This subtype of PyObject represents a Python...

  • 1. Introduction
    Python/C API Reference Manual Previous: Contents Up: Python/C API Reference Manual Next: 1.1 Include Files 1. Introduction The Application Programmer's Interface to Python gives C and C++ programmers...

  • 6.5 Iterator Protocol
    Python/C API Reference Manual Previous: 6.4 Mapping Protocol Up: 6. Abstract Objects Layer Next: 6.6 Buffer Protocol 6.5 Iterator Protocol New in version 2.2. There are only a couple of functions...

  • 7.5.6 Iterator Objects
    Python/C API Reference Manual Previous: 7.5.5 Module Objects Up: 7.5 Other Objects Next: 7.5.7 Descriptor Objects 7.5.6 Iterator Objects Python provides two general-purpose iterator objects. The...

  • 7.3.5 List Objects
    Python/C API Reference Manual Previous: 7.3.4 Tuple Objects Up: 7.3 Sequence Objects Next: 7.4 Mapping Objects 7.3.5 List Objects PyListObject This subtype of PyObject represents a Python list...

  • 7.2.3 Long Integer Objects
    Python/C API Reference Manual Previous: 7.2.2 Boolean Objects Up: 7.2 Numeric Objects Next: 7.2.4 Floating Point Objects 7.2.3 Long Integer Objects PyLongObject This subtype of PyObject represents a...

  • 7.4 Mapping Objects
    Python/C API Reference Manual Previous: 7.3.5 List Objects Up: 7. Concrete Objects Layer Next: 7.4.1 Dictionary Objects 7.4 Mapping Objects Subsections 7.4.1 Dictionary Objects Python/C API Reference...

  • 6.4 Mapping Protocol
    Python/C API Reference Manual Previous: 6.3 Sequence Protocol Up: 6. Abstract Objects Layer Next: 6.5 Iterator Protocol 6.4 Mapping Protocol int  PyMapping_Check ( PyObject * o ) Return 1 if the...

  • 10.4 Mapping Object Structures
    Python/C API Reference Manual Previous: 10.3 Type Objects Up: 10. Object Implementation Support Next: 10.5 Number Object Structures 10.4 Mapping Object Structures PyMappingMethods Structure used to...

  • 5.4 Data marshalling support
    Python/C API Reference Manual Previous: 5.3 Importing Modules Up: 5. Utilities Next: 5.5 Parsing arguments and 5.4 Data marshalling support These routines allow C code to work with serialized objects...

  • 9. Memory Management
    Python/C API Reference Manual Previous: 8.3 Advanced Debugger Support Up: Python/C API Reference Manual Next: 9.1 Overview 9. Memory Management Subsections 9.1 Overview 9.2 Memory Interface 9.3...

  • 9.3 Examples
    Python/C API Reference Manual Previous: 9.2 Memory Interface Up: 9. Memory Management Next: 10. Object Implementation Support 9.3 Examples Here is the example from section 9.1 , rewritten so that the...

  • 9.2 Memory Interface
    Python/C API Reference Manual Previous: 9.1 Overview Up: 9. Memory Management Next: 9.3 Examples 9.2 Memory Interface The following function sets, modeled after the ANSI C standard, but specifying...

  • 9.1 Overview
    Python/C API Reference Manual Previous: 9. Memory Management Up: 9. Memory Management Next: 9.2 Memory Interface 9.1 Overview Memory management in Python involves a private heap containing all Python...

  • 7.5.4 Method Objects
    Python/C API Reference Manual Previous: 7.5.3 Function Objects Up: 7.5 Other Objects Next: 7.5.5 Module Objects 7.5.4 Method Objects There are some useful functions that are useful for working with...

  • 7.5.5 Module Objects
    Python/C API Reference Manual Previous: 7.5.4 Method Objects Up: 7.5 Other Objects Next: 7.5.6 Iterator Objects 7.5.5 Module Objects There are only a few functions special to module objects....

  • 10. Object Implementation Support
    Python/C API Reference Manual Previous: 9.3 Examples Up: Python/C API Reference Manual Next: 10.1 Allocating Objects on 10. Object Implementation Support This chapter describes the functions, types,...

  • 4.2 Deprecation of String Exceptions
    Python/C API Reference Manual Previous: 4.1 Standard Exceptions Up: 4. Exception Handling Next: 5. Utilities 4.2 Deprecation of String Exceptions All exceptions built into Python or provided in the...

  • 7.2.5.1 Complex Numbers as C Structures
    Python/C API Reference Manual Previous: 7.2.5 Complex Number Objects Up: 7.2.5 Complex Number Objects Next: 7.2.5.2 Complex Numbers as 7.2.5.1 Complex Numbers as C Structures Note that the functions...

  • 7.2.5.2 Complex Numbers as Python Objects
    Python/C API Reference Manual Previous: 7.2.5.1 Complex Numbers as Up: 7.2.5 Complex Number Objects Next: 7.3 Sequence Objects 7.2.5.2 Complex Numbers as Python Objects PyComplexObject This subtype...

  • B. History and License
    Python/C API Reference Manual Previous: A. Reporting Bugs Up: Python/C API Reference Manual Next: B.1 History of the B. History and License Subsections B.1 History of the software B.2 Terms and...

  • B.1 History of the software
    Python/C API Reference Manual Previous: B. History and License Up: B. History and License Next: B.2 Terms and conditions B.1 History of the software Python was created in the early 1990s by Guido van...

  • B.2 Terms and conditions for accessing or otherwise using Python
    Python/C API Reference Manual Previous: B.1 History of the Up: B. History and License Next: B.3 Licenses and Acknowledgements B.2 Terms and conditions for accessing or otherwise using Python PSF...

  • B.3 Licenses and Acknowledgements for Incorporated Software
    Python/C API Reference Manual Previous: B.2 Terms and conditions Up: B. History and License Next: B.3.1 Mersenne Twister B.3 Licenses and Acknowledgements for Incorporated Software This section is an...

  • B.3.1 Mersenne Twister
    Python/C API Reference Manual Previous: B.3 Licenses and Acknowledgements Up: B.3 Licenses and Acknowledgements Next: B.3.2 Sockets B.3.1 Mersenne Twister The _random module includes code based on a...

  • B.3.2 Sockets
    Python/C API Reference Manual Previous: B.3.1 Mersenne Twister Up: B.3 Licenses and Acknowledgements Next: B.3.3 Floating point exception B.3.2 Sockets The socket module uses the functions,...

  • B.3.3 Floating point exception control
    Python/C API Reference Manual Previous: B.3.2 Sockets Up: B.3 Licenses and Acknowledgements Next: B.3.4 MD5 message digest B.3.3 Floating point exception control The source for the fpectl module...

  • B.3.4 MD5 message digest algorithm
    Python/C API Reference Manual Previous: B.3.3 Floating point exception Up: B.3 Licenses and Acknowledgements Next: B.3.5 Asynchronous socket services B.3.4 MD5 message digest algorithm The source...

  • B.3.5 Asynchronous socket services
    Python/C API Reference Manual Previous: B.3.4 MD5 message digest Up: B.3 Licenses and Acknowledgements Next: B.3.6 Cookie management B.3.5 Asynchronous socket services The asynchat and asyncore...

  • B.3.6 Cookie management
    Python/C API Reference Manual Previous: B.3.5 Asynchronous socket services Up: B.3 Licenses and Acknowledgements Next: B.3.7 Profiling B.3.6 Cookie management The Cookie module contains the following...

  • B.3.7 Profiling
    Python/C API Reference Manual Previous: B.3.6 Cookie management Up: B.3 Licenses and Acknowledgements Next: B.3.8 Execution tracing B.3.7 Profiling The profile and pstats modules contain the...

  • B.3.8 Execution tracing
    Python/C API Reference Manual Previous: B.3.7 Profiling Up: B.3 Licenses and Acknowledgements Next: B.3.9 UUencode and UUdecode B.3.8 Execution tracing The trace module contains the following notice:...

  • B.3.9 UUencode and UUdecode functions
    Python/C API Reference Manual Previous: B.3.8 Execution tracing Up: B.3 Licenses and Acknowledgements Next: B.3.10 XML Remote Procedure B.3.9 UUencode and UUdecode functions The uu module contains...

  • B.3.10 XML Remote Procedure Calls
    Python/C API Reference Manual Previous: B.3.9 UUencode and UUdecode Up: B.3 Licenses and Acknowledgements Next: Index B.3.10 XML Remote Procedure Calls The xmlrpclib module contains the following...

  • 7.1.2 The None Object
    Python/C API Reference Manual Previous: 7.1.1 Type Objects Up: 7.1 Fundamental Objects Next: 7.2 Numeric Objects 7.1.2 The None Object Note that the PyTypeObject for None is not directly exposed in...

  • 6.2 Number Protocol
    Python/C API Reference Manual Previous: 6.1 Object Protocol Up: 6. Abstract Objects Layer Next: 6.3 Sequence Protocol 6.2 Number Protocol int  PyNumber_Check ( PyObject * o ) Returns 1 if the...

  • 10.5 Number Object Structures
    Python/C API Reference Manual Previous: 10.4 Mapping Object Structures Up: 10. Object Implementation Support Next: 10.6 Sequence Object Structures 10.5 Number Object Structures PyNumberMethods...

  • 7.2 Numeric Objects
    Python/C API Reference Manual Previous: 7.1.2 The None Object Up: 7. Concrete Objects Layer Next: 7.2.1 Plain Integer Objects 7.2 Numeric Objects Subsections 7.2.1 Plain Integer Objects 7.2.2 Boolean...

  • 6.1 Object Protocol
    Python/C API Reference Manual Previous: 6. Abstract Objects Layer Up: 6. Abstract Objects Layer Next: 6.2 Number Protocol 6.1 Object Protocol int  PyObject_Print ( PyObject * o , FILE * fp , int...

  • 1.2 Objects, Types and Reference Counts
    Python/C API Reference Manual Previous: 1.1 Include Files Up: 1. Introduction Next: 1.2.1 Reference Counts 1.2 Objects, Types and Reference Counts Most Python/C API functions have one or more...

  • 5.1 Operating System Utilities
    Python/C API Reference Manual Previous: 5. Utilities Up: 5. Utilities Next: 5.2 Process Control 5.1 Operating System Utilities int  Py_FdIsInteractive ( FILE * fp , const char * filename )...

  • 7.5 Other Objects
    Python/C API Reference Manual Previous: 7.4.1 Dictionary Objects Up: 7. Concrete Objects Layer Next: 7.5.1 File Objects 7.5 Other Objects Subsections 7.5.1 File Objects 7.5.2 Instance Objects 7.5.3...

  • 5.2 Process Control
    Python/C API Reference Manual Previous: 5.1 Operating System Utilities Up: 5. Utilities Next: 5.3 Importing Modules 5.2 Process Control void  Py_FatalError ( const char * message ) Print a fatal...

  • 8.2 Profiling and Tracing
    Python/C API Reference Manual Previous: 8.1 Thread State and Up: 8. Initialization, Finalization, and Next: 8.3 Advanced Debugger Support 8.2 Profiling and Tracing The Python interpreter provides...

  • 1.2.1.1 Reference Count Details
    Python/C API Reference Manual Previous: 1.2.1 Reference Counts Up: 1.2.1 Reference Counts Next: 1.2.2 Types 1.2.1.1 Reference Count Details The reference count behavior of functions in the Python/C...

  • 1.2.1 Reference Counts
    Python/C API Reference Manual Previous: 1.2 Objects, Types and Up: 1.2 Objects, Types and Next: 1.2.1.1 Reference Count Details 1.2.1 Reference Counts The reference count is important because today's...

  • A. Reporting Bugs
    Python/C API Reference Manual Previous: 10.9 Supporting Cyclic Garbage Up: Python/C API Reference Manual Next: B. History and License A. Reporting Bugs Python is a mature programming language which...

  • 6.3 Sequence Protocol
    Python/C API Reference Manual Previous: 6.2 Number Protocol Up: 6. Abstract Objects Layer Next: 6.4 Mapping Protocol 6.3 Sequence Protocol int  PySequence_Check ( PyObject * o ) Return 1 if the...

  • 7.3 Sequence Objects
    Python/C API Reference Manual Previous: 7.2.5.2 Complex Numbers as Up: 7. Concrete Objects Layer Next: 7.3.1 String Objects 7.3 Sequence Objects Generic operations on sequence objects were discussed...

  • 10.6 Sequence Object Structures
    Python/C API Reference Manual Previous: 10.5 Number Object Structures Up: 10. Object Implementation Support Next: 10.7 Buffer Object Structures 10.6 Sequence Object Structures PySequenceMethods...

  • 7.5.14 Set Objects
    Python/C API Reference Manual Previous: 7.5.13 DateTime Objects Up: 7.5 Other Objects Next: 8. Initialization, Finalization, and 7.5.14 Set Objects New in version 2.5. This section details the public...

  • 7.5.8 Slice Objects
    Python/C API Reference Manual Previous: 7.5.7 Descriptor Objects Up: 7.5 Other Objects Next: 7.5.9 Weak Reference Objects 7.5.8 Slice Objects PyTypeObject PySlice_Type The type object for slice...

  • 4.1 Standard Exceptions
    Python/C API Reference Manual Previous: 4. Exception Handling Up: 4. Exception Handling Next: 4.2 Deprecation of String 4.1 Standard Exceptions All standard Python exceptions are available as global...

  • 7.3.1 String Objects
    Python/C API Reference Manual Previous: 7.3 Sequence Objects Up: 7.3 Sequence Objects Next: 7.3.2 Unicode Objects 7.3.1 String Objects These functions raise TypeError when expecting a string...

  • 10.9 Supporting Cyclic Garbage Collection
    Python/C API Reference Manual Previous: 10.8 Supporting the Iterator Up: 10. Object Implementation Support Next: A. Reporting Bugs 10.9 Supporting Cyclic Garbage Collection Python's support for...

  • 10.8 Supporting the Iterator Protocol
    Python/C API Reference Manual Previous: 10.7 Buffer Object Structures Up: 10. Object Implementation Support Next: 10.9 Supporting Cyclic Garbage 10.8 Supporting the Iterator Protocol Python/C API...

  • 8.1 Thread State and the Global Interpreter Lock
    Python/C API Reference Manual Previous: 8. Initialization, Finalization, and Up: 8. Initialization, Finalization, and Next: 8.2 Profiling and Tracing 8.1 Thread State and the Global Interpreter Lock...

  • 7.3.4 Tuple Objects
    Python/C API Reference Manual Previous: 7.3.3 Buffer Objects Up: 7.3 Sequence Objects Next: 7.3.5 List Objects 7.3.4 Tuple Objects PyTupleObject This subtype of PyObject represents a Python tuple...

  • 7.1.1 Type Objects
    Python/C API Reference Manual Previous: 7.1 Fundamental Objects Up: 7.1 Fundamental Objects Next: 7.1.2 The None Object 7.1.1 Type Objects PyTypeObject The C structure of the objects used to describe...

  • 1.2.2 Types
    Python/C API Reference Manual Previous: 1.2.1.1 Reference Count Details Up: 1.2 Objects, Types and Next: 1.3 Exceptions 1.2.2 Types There are few other data types that play a significant role in the...

  • typestruct
    typedef struct _typeobject { PyObject_VAR_HEAD char *tp_name; /* For printing, in format " . " */ int tp_basicsize, tp_itemsize; /* For allocation */ /* Methods to implement standard operations */...

  • 10.3 Type Objects
    Python/C API Reference Manual Previous: 10.2 Common Object Structures Up: 10. Object Implementation Support Next: 10.4 Mapping Object Structures 10.3 Type Objects Perhaps one of the most important...

  • 7.3.2.2 Methods and Slot Functions
    Python/C API Reference Manual Previous: 7.3.2.1 Built-in Codecs Up: 7.3.2 Unicode Objects Next: 7.3.3 Buffer Objects 7.3.2.2 Methods and Slot Functions The following APIs are capable of handling...

  • 7.3.2 Unicode Objects
    Python/C API Reference Manual Previous: 7.3.1 String Objects Up: 7.3 Sequence Objects Next: 7.3.2.1 Built-in Codecs 7.3.2 Unicode Objects These are the basic Unicode object types used for the Unicode...

  • 5. Utilities
    Python/C API Reference Manual Previous: 4.2 Deprecation of String Up: Python/C API Reference Manual Next: 5.1 Operating System Utilities 5. Utilities The functions in this chapter perform various...

  • 2. The Very High Level Layer
    Python/C API Reference Manual Previous: 1.5 Debugging Builds Up: Python/C API Reference Manual Next: 3. Reference Counting 2. The Very High Level Layer The functions in this chapter will let you...

  • 7.5.9 Weak Reference Objects
    Python/C API Reference Manual Previous: 7.5.8 Slice Objects Up: 7.5 Other Objects Next: 7.5.10 CObjects 7.5.9 Weak Reference Objects Python supports weak references as first-class objects. There are...

  • 11. API Reference
    Distributing Python Modules Previous: 10.2 Creating a source Up: Distributing Python Modules Next: 11.1 distutils.core 11. API Reference Subsections 11.1 distutils.core -- Core Distutils...

  • 5. Creating Built Distributions
    Distributing Python Modules Previous: 4.2 Manifest-related options Up: Distributing Python Modules Next: 5.1 Creating dumb built 5. Creating Built Distributions A ``built distribution'' is what...

  • 1.1 Concepts & Terminology
    Distributing Python Modules Previous: 1. An Introduction to Up: 1. An Introduction to Next: 1.2 A Simple Example 1.1 Concepts & Terminology Using the Distutils is quite simple, both for module...

  • 5.1 Creating dumb built distributions
    Distributing Python Modules Previous: 5. Creating Built Distributions Up: 5. Creating Built Distributions Next: 5.2 Creating RPM packages 5.1 Creating dumb built distributions Need to document...

  • 5.2 Creating RPM packages
    Distributing Python Modules Previous: 5.1 Creating dumb built Up: 5. Creating Built Distributions Next: 5.3 Creating Windows Installers 5.2 Creating RPM packages The RPM format is used by many...

  • 2.3 Describing extension modules
    Distributing Python Modules Previous: 2.2 Listing individual modules Up: 2. Writing the Setup Next: 2.4 Relationships between Distributions Subsections 2.3.1 Extension names and packages 2.3.2...

  • Distributing Python Modules
    Distributing Python Modules Up: Python Documentation Index Next: 1. An Introduction to Distributing Python Modules Greg Ward Python Software Foundation Email: distutils-sig@python.org Anthony Baxter...

  • 1.4 Distutils-specific terminology
    Distributing Python Modules Previous: 1.3 General Python terminology Up: 1. An Introduction to Next: 2. Writing the Setup 1.4 Distutils-specific terminology The following terms apply more...

  • 8. Examples
    Distributing Python Modules Previous: 7. Uploading Packages to Up: Distributing Python Modules Next: 8.1 Pure Python distribution 8. Examples This chapter provides a number of basic examples to help...

  • 9. Extending Distutils
    Distributing Python Modules Previous: 8.3 Single extension module Up: Distributing Python Modules Next: 9.1 Integrating new commands 9. Extending Distutils Distutils can be extended in various ways....

  • 10.1 Installing modules: the install command family
    Distributing Python Modules Previous: 10. Command Reference Up: 10. Command Reference Next: 10.2 Creating a source Subsections 10.1.1 install_data 10.1.2 install_scripts 10.1 Installing modules: the...

  • 2.2 Listing individual modules
    Distributing Python Modules Previous: 2.1 Listing whole packages Up: 2. Writing the Setup Next: 2.3 Describing extension modules 2.2 Listing individual modules For a small module distribution, you...

  • 2.1 Listing whole packages
    Distributing Python Modules Previous: 2. Writing the Setup Up: 2. Writing the Setup Next: 2.2 Listing individual modules 2.1 Listing whole packages The packages option tells the Distutils to process...

  • 4.1 Specifying the files to distribute
    Distributing Python Modules Previous: 4. Creating a Source Up: 4. Creating a Source Next: 4.2 Manifest-related options 4.1 Specifying the files to distribute If you don't supply an explicit list of...

  • 4.2 Manifest-related options
    Distributing Python Modules Previous: 4.1 Specifying the files Up: 4. Creating a Source Next: 5. Creating Built Distributions 4.2 Manifest-related options The normal course of operations for the...

  • 2.8 Additional meta-data
    Distributing Python Modules Previous: 2.7 Installing Additional Files Up: 2. Writing the Setup Next: 2.9 Debugging the setup 2.8 Additional meta-data The setup script may include additional meta-data...

  • 11.9 distutils.archive_util -- Archiving utilities
    Distributing Python Modules Previous: 11.8 distutils.mwerkscompiler Up: 11. API Reference Next: 11.10 distutils.dep_util 11.9 distutils.archive_util -- Archiving utilities This module provides a few...

  • 11.5 distutils.bcppcompiler -- Borland Compiler
    Distributing Python Modules Previous: 11.4 distutils.msvccompiler Up: 11. API Reference Next: 11.6 distutils.cygwincompiler 11.5 distutils.bcppcompiler -- Borland Compiler This module provides...

  • 11.2 distutils.ccompiler -- CCompiler base class
    Distributing Python Modules Previous: 11.1 distutils.core Up: 11. API Reference Next: 11.3 distutils.unixccompiler 11.2 distutils.ccompiler -- CCompiler base class This module provides the abstract...

  • 11.25 distutils.cmd -- Abstract base class for Distutils commands
    Distributing Python Modules Previous: 11.24 distutils.version Up: 11. API Reference Next: 11.26 distutils.command 11.25 distutils.cmd -- Abstract base class for Distutils commands This module...

  • 11.27 distutils.command.bdist -- Build a binary installer
    Distributing Python Modules Previous: 11.26 distutils.command Up: 11. API Reference Next: 11.28 distutils.command.bdist_packager 11.27 distutils.command.bdist -- Build a binary installer Distributing...

  • 11.29 distutils.command.bdist_dumb -- Build a ``dumb'' installer
    Distributing Python Modules Previous: 11.28 distutils.command.bdist_packager Up: 11. API Reference Next: 11.30 distutils.command.bdist_rpm 11.29 distutils.command.bdist_dumb -- Build a ``dumb''...

  • 11.28 distutils.command.bdist_packager -- Abstract base class for packagers
    Distributing Python Modules Previous: 11.27 distutils.command.bdist Up: 11. API Reference Next: 11.29 distutils.command.bdist_dumb 11.28 distutils.command.bdist_packager -- Abstract base class for...

  • 11.30 distutils.command.bdist_rpm -- Build a binary distribution as a Redhat RPM and SRPM
    Distributing Python Modules Previous: 11.29 distutils.command.bdist_dumb Up: 11. API Reference Next: 11.31 distutils.command.bdist_wininst 11.30 distutils.command.bdist_rpm -- Build a binary...

  • 11.31 distutils.command.bdist_wininst -- Build a Windows installer
    Distributing Python Modules Previous: 11.30 distutils.command.bdist_rpm Up: 11. API Reference Next: 11.32 distutils.command.sdist 11.31 distutils.command.bdist_wininst -- Build a Windows installer...

  • 11.33 distutils.command.build -- Build all files of a package
    Distributing Python Modules Previous: 11.32 distutils.command.sdist Up: 11. API Reference Next: 11.34 distutils.command.build_clib 11.33 distutils.command.build -- Build all files of a package...

  • 11.34 distutils.command.build_clib -- Build any C libraries in a package
    Distributing Python Modules Previous: 11.33 distutils.command.build Up: 11. API Reference Next: 11.35 distutils.command.build_ext 11.34 distutils.command.build_clib -- Build any C libraries in a...

  • 11.35 distutils.command.build_ext -- Build any extensions in a package
    Distributing Python Modules Previous: 11.34 distutils.command.build_clib Up: 11. API Reference Next: 11.36 distutils.command.build_py 11.35 distutils.command.build_ext -- Build any extensions in a...

  • 11.36 distutils.command.build_py -- Build the .py/.pyc files of a package
    Distributing Python Modules Previous: 11.35 distutils.command.build_ext Up: 11. API Reference Next: 11.37 distutils.command.build_scripts 11.36 distutils.command.build_py -- Build the .py/.pyc files...

  • 11.37 distutils.command.build_scripts -- Build the scripts of a package
    Distributing Python Modules Previous: 11.36 distutils.command.build_py Up: 11. API Reference Next: 11.38 distutils.command.clean 11.37 distutils.command.build_scripts -- Build the scripts of a...

  • 11.38 distutils.command.clean -- Clean a package build area
    Distributing Python Modules Previous: 11.37 distutils.command.build_scripts Up: 11. API Reference Next: 11.39 distutils.command.config 11.38 distutils.command.clean -- Clean a package build area...

  • 11.39 distutils.command.config -- Perform package configuration
    Distributing Python Modules Previous: 11.38 distutils.command.clean Up: 11. API Reference Next: 11.40 distutils.command.install 11.39 distutils.command.config -- Perform package configuration...

  • 11.26 distutils.command -- Individual Distutils commands
    Distributing Python Modules Previous: 11.25 distutils.cmd Up: 11. API Reference Next: 11.27 distutils.command.bdist 11.26 distutils.command -- Individual Distutils commands Distributing Python...

  • 11.40 distutils.command.install -- Install a package
    Distributing Python Modules Previous: 11.39 distutils.command.config Up: 11. API Reference Next: 11.41 distutils.command.install_data 11.40 distutils.command.install -- Install a package Distributing...

  • 11.41 distutils.command.install_data -- Install data files from a package
    Distributing Python Modules Previous: 11.40 distutils.command.install Up: 11. API Reference Next: 11.42 distutils.command.install_headers 11.41 distutils.command.install_data -- Install data files...

  • 11.42 distutils.command.install_headers -- Install C/C++ header files from a package
    Distributing Python Modules Previous: 11.41 distutils.command.install_data Up: 11. API Reference Next: 11.43 distutils.command.install_lib 11.42 distutils.command.install_headers -- Install C/C++...

  • 11.43 distutils.command.install_lib -- Install library files from a package
    Distributing Python Modules Previous: 11.42 distutils.command.install_headers Up: 11. API Reference Next: 11.44 distutils.command.install_scripts 11.43 distutils.command.install_lib -- Install...

  • 11.44 distutils.command.install_scripts -- Install script files from a package
    Distributing Python Modules Previous: 11.43 distutils.command.install_lib Up: 11. API Reference Next: 11.45 distutils.command.register 11.44 distutils.command.install_scripts -- Install script files...

  • 11.45 distutils.command.register -- Register a module with the Python Package Index
    Distributing Python Modules Previous: 11.44 distutils.command.install_scripts Up: 11. API Reference Next: 11.46 Creating a new 11.45 distutils.command.register -- Register a module with the Python...

  • 11.32 distutils.command.sdist -- Build a source distribution
    Distributing Python Modules Previous: 11.31 distutils.command.bdist_wininst Up: 11. API Reference Next: 11.33 distutils.command.build 11.32 distutils.command.sdist -- Build a source distribution...

  • 11.1 distutils.core -- Core Distutils functionality
    Distributing Python Modules Previous: 11. API Reference Up: 11. API Reference Next: 11.2 distutils.ccompiler 11.1 distutils.core -- Core Distutils functionality The distutils.core module is the only...

  • 11.6 distutils.cygwincompiler -- Cygwin Compiler
    Distributing Python Modules Previous: 11.5 distutils.bcppcompiler Up: 11. API Reference Next: 11.7 distutils.emxccompiler 11.6 distutils.cygwincompiler -- Cygwin Compiler This module provides the...

  • 11.16 distutils.debug -- Distutils debug mode
    Distributing Python Modules Previous: 11.15 distutils.extension Up: 11. API Reference Next: 11.17 distutils.errors 11.16 distutils.debug -- Distutils debug mode This module provides the DEBUG flag....

  • 11.10 distutils.dep_util -- Dependency checking
    Distributing Python Modules Previous: 11.9 distutils.archive_util Up: 11. API Reference Next: 11.11 distutils.dir_util 11.10 distutils.dep_util -- Dependency checking This module provides functions...

  • 11.11 distutils.dir_util -- Directory tree operations
    Distributing Python Modules Previous: 11.10 distutils.dep_util Up: 11. API Reference Next: 11.12 distutils.file_util 11.11 distutils.dir_util -- Directory tree operations This module provides...

  • 11.14 distutils.dist -- The Distribution class
    Distributing Python Modules Previous: 11.13 distutils.util Up: 11. API Reference Next: 11.15 distutils.extension 11.14 distutils.dist -- The Distribution class This module provides the Distribution...

  • 11.7 distutils.emxccompiler -- OS/2 EMX Compiler
    Distributing Python Modules Previous: 11.6 distutils.cygwincompiler Up: 11. API Reference Next: 11.8 distutils.mwerkscompiler 11.7 distutils.emxccompiler -- OS/2 EMX Compiler This module provides the...

  • 11.17 distutils.errors -- Distutils exceptions
    Distributing Python Modules Previous: 11.16 distutils.debug Up: 11. API Reference Next: 11.18 distutils.fancy_getopt 11.17 distutils.errors -- Distutils exceptions Provides exceptions used by the...

  • 11.15 distutils.extension -- The Extension class
    Distributing Python Modules Previous: 11.14 distutils.dist Up: 11. API Reference Next: 11.16 distutils.debug 11.15 distutils.extension -- The Extension class This module provides the Extension class,...

  • 11.18 distutils.fancy_getopt -- Wrapper around the standard getopt module
    Distributing Python Modules Previous: 11.17 distutils.errors Up: 11. API Reference Next: 11.19 distutils.filelist 11.18 distutils.fancy_getopt -- Wrapper around the standard getopt module This module...

  • 11.19 distutils.filelist -- The FileList class
    Distributing Python Modules Previous: 11.18 distutils.fancy_getopt Up: 11. API Reference Next: 11.20 distutils.log 11.19 distutils.filelist -- The FileList class This module provides the FileList...

  • 11.12 distutils.file_util -- Single file operations
    Distributing Python Modules Previous: 11.11 distutils.dir_util Up: 11. API Reference Next: 11.13 distutils.util 11.12 distutils.file_util -- Single file operations This module contains some utility...

  • 11.20 distutils.log -- Simple PEP 282-style logging
    Distributing Python Modules Previous: 11.19 distutils.filelist Up: 11. API Reference Next: 11.21 distutils.spawn 11.20 distutils.log -- Simple PEP 282-style logging Warning: Should be replaced with...

  • 11.4 distutils.msvccompiler -- Microsoft Compiler
    Distributing Python Modules Previous: 11.3 distutils.unixccompiler Up: 11. API Reference Next: 11.5 distutils.bcppcompiler 11.4 distutils.msvccompiler -- Microsoft Compiler This module provides...

  • 11.8 distutils.mwerkscompiler -- Metrowerks CodeWarrior support
    Distributing Python Modules Previous: 11.7 distutils.emxccompiler Up: 11. API Reference Next: 11.9 distutils.archive_util 11.8 distutils.mwerkscompiler -- Metrowerks CodeWarrior support Contains...

  • 11.21 distutils.spawn -- Spawn a sub-process
    Distributing Python Modules Previous: 11.20 distutils.log Up: 11. API Reference Next: 11.22 distutils.sysconfig 11.21 distutils.spawn -- Spawn a sub-process This module provides the spawn() function,...

  • 11.22 distutils.sysconfig -- System configuration information
    Distributing Python Modules Previous: 11.21 distutils.spawn Up: 11. API Reference Next: 11.23 distutils.text_file 11.22 distutils.sysconfig -- System configuration information The distutils.sysconfig...

  • 11.23 distutils.text_file -- The TextFile class
    Distributing Python Modules Previous: 11.22 distutils.sysconfig Up: 11. API Reference Next: 11.24 distutils.version 11.23 distutils.text_file -- The TextFile class This module provides the TextFile...

  • 11.3 distutils.unixccompiler -- Unix C Compiler
    Distributing Python Modules Previous: 11.2 distutils.ccompiler Up: 11. API Reference Next: 11.4 distutils.msvccompiler 11.3 distutils.unixccompiler -- Unix C Compiler This module provides the...

  • 11.13 distutils.util -- Miscellaneous other utility functions
    Distributing Python Modules Previous: 11.12 distutils.file_util Up: 11. API Reference Next: 11.14 distutils.dist 11.13 distutils.util -- Miscellaneous other utility functions This module contains...

  • 11.24 distutils.version -- Version number classes
    Distributing Python Modules Previous: 11.23 distutils.text_file Up: 11. API Reference Next: 11.25 distutils.cmd 11.24 distutils.version -- Version number classes Distributing Python Modules Previous:...

  • 2.4 Relationships between Distributions and Packages
    Distributing Python Modules Previous: 2.3 Describing extension modules Up: 2. Writing the Setup Next: 2.5 Installing Scripts 2.4 Relationships between Distributions and Packages A distribution may...

  • 2.5 Installing Scripts
    Distributing Python Modules Previous: 2.4 Relationships between Distributions Up: 2. Writing the Setup Next: 2.6 Installing Package Data 2.5 Installing Scripts So far we have been dealing with pure...

  • 2.6 Installing Package Data
    Distributing Python Modules Previous: 2.5 Installing Scripts Up: 2. Writing the Setup Next: 2.7 Installing Additional Files 2.6 Installing Package Data Often, additional files need to be installed...

  • 2.7 Installing Additional Files
    Distributing Python Modules Previous: 2.6 Installing Package Data Up: 2. Writing the Setup Next: 2.8 Additional meta-data 2.7 Installing Additional Files The data_files option can be used to specify...

  • 2.9 Debugging the setup script
    Distributing Python Modules Previous: 2.8 Additional meta-data Up: 2. Writing the Setup Next: 3. Writing the Setup 2.9 Debugging the setup script Sometimes things go wrong, and the setup script...

  • 9.1 Integrating new commands
    Distributing Python Modules Previous: 9. Extending Distutils Up: 9. Extending Distutils Next: 9.2 Adding new distribution 9.1 Integrating new commands There are different ways to integrate new...

  • 9.2 Adding new distribution types
    Distributing Python Modules Previous: 9.1 Integrating new commands Up: 9. Extending Distutils Next: 10. Command Reference 9.2 Adding new distribution types Commands that create distributions (files...

  • 11.46 Creating a new Distutils command
    Distributing Python Modules Previous: 11.45 distutils.command.register Up: 11. API Reference Next: Module Index 11.46 Creating a new Distutils command This section outlines the steps to create a new...

  • 6. Registering with the Package Index
    Distributing Python Modules Previous: 5.3 Creating Windows Installers Up: Distributing Python Modules Next: 6.1 The .pypirc file 6. Registering with the Package Index The Python Package Index (PyPI)...

  • 7. Uploading Packages to the Package Index
    Distributing Python Modules Previous: 6.1 The .pypirc file Up: Distributing Python Modules Next: 8. Examples 7. Uploading Packages to the Package Index New in version 2.5. The Python Package Index...

  • 5.3 Creating Windows Installers
    Distributing Python Modules Previous: 5.2 Creating RPM packages Up: 5. Creating Built Distributions Next: 6. Registering with the Subsections 5.3.1 The Postinstallation script 5.3 Creating Windows...

  • 8.1 Pure Python distribution (by module)
    Distributing Python Modules Previous: 8. Examples Up: 8. Examples Next: 8.2 Pure Python distribution 8.1 Pure Python distribution (by module) If you're just distributing a couple of modules,...

  • 8.2 Pure Python distribution (by package)
    Distributing Python Modules Previous: 8.1 Pure Python distribution Up: 8. Examples Next: 8.3 Single extension module 8.2 Pure Python distribution (by package) If you have more than a couple of...

  • 6.1 The .pypirc file
    Distributing Python Modules Previous: 6. Registering with the Up: 6. Registering with the Next: 7. Uploading Packages to 6.1 The .pypirc file The format of the .pypirc file is formated as follows:...

  • 1.3 General Python terminology
    Distributing Python Modules Previous: 1.2 A Simple Example Up: 1. An Introduction to Next: 1.4 Distutils-specific terminology 1.3 General Python terminology If you're reading this document, you...

  • 10. Command Reference
    Distributing Python Modules Previous: 9.2 Adding new distribution Up: Distributing Python Modules Next: 10.1 Installing modules: the 10. Command Reference Subsections 10.1 Installing modules: the...

  • 10.2 Creating a source distribution: the sdist command
    Distributing Python Modules Previous: 10.1 Installing modules: the Up: 10. Command Reference Next: 11. API Reference 10.2 Creating a source distribution: the sdist command fragment moved down from...

  • 3. Writing the Setup Configuration File
    Distributing Python Modules Previous: 2.9 Debugging the setup Up: Distributing Python Modules Next: 4. Creating a Source 3. Writing the Setup Configuration File Often, it's not possible to write down...

  • 2. Writing the Setup Script
    Distributing Python Modules Previous: 1.4 Distutils-specific terminology Up: Distributing Python Modules Next: 2.1 Listing whole packages 2. Writing the Setup Script The setup script is the centre of...

  • 1.2 A Simple Example
    Distributing Python Modules Previous: 1.1 Concepts & Terminology Up: 1. An Introduction to Next: 1.3 General Python terminology 1.2 A Simple Example The setup script is usually quite simple,...

  • 8.3 Single extension module
    Distributing Python Modules Previous: 8.2 Pure Python distribution Up: 8. Examples Next: 9. Extending Distutils 8.3 Single extension module Extension modules are specified using the ext_modules...

  • 4. Creating a Source Distribution
    Distributing Python Modules Previous: 3. Writing the Setup Up: Distributing Python Modules Next: 4.1 Specifying the files 4. Creating a Source Distribution As shown in section  1.2 , you use the...

  • 5 Document Classes
    Documenting Python Previous: 4.3 Common Environments Up: Documenting Python Next: 6 Special Markup Constructs 5 Document Classes Two LaTeX document classes are defined specifically for use with the...

  • 7.3 Working on Cygwin
    Documenting Python Previous: 7.2 Internal Tools Up: 7 Processing Tools Next: 8 Including Graphics 7.3 Working on Cygwin Installing the required tools under Cygwin under Cygwin can be a little...

  • 2 Directory Structure
    Documenting Python Previous: 1 Introduction Up: Documenting Python Next: 3 Style Guide 2 Directory Structure The source distribution for the standard Python documentation contains a large number of...

  • 9.2 Discussion Forums
    Documenting Python Previous: 9.1 Structured Documentation Up: 9 Future Directions Next: About this document ... 9.2 Discussion Forums Discussion of the future of the Python documentation and related...

  • Documenting Python
    Documenting Python Up: Python Documentation Index Next: Contents Documenting Python Fred L. Drake, Jr. PythonLabs Email: fdrake@acm.org Release 2.5 19th September, 2006 Abstract: The Python language...

  • 9 Future Directions
    Documenting Python Previous: 8 Including Graphics Up: Documenting Python Next: 9.1 Structured Documentation 9 Future Directions The history of the Python documentation is full of changes, most of...

  • 6.12 Grammar Production Displays
    Documenting Python Previous: 6.11 Index-generating Markup Up: 6 Special Markup Constructs Next: 6.13 Graphical Interface Components 6.12 Grammar Production Displays Special markup is available for...

  • 8 Including Graphics
    Documenting Python Previous: 7.3 Working on Cygwin Up: Documenting Python Next: 9 Future Directions 8 Including Graphics The standard documentation included with Python makes no use of diagrams or...

  • 6.13 Graphical Interface Components
    Documenting Python Previous: 6.12 Grammar Production Displays Up: 6 Special Markup Constructs Next: 7 Processing Tools 6.13 Graphical Interface Components The components of graphical interfaces will...

  • 6.11 Index-generating Markup
    Documenting Python Previous: 6.10 Reference List Markup Up: 6 Special Markup Constructs Next: 6.12 Grammar Production Displays 6.11 Index-generating Markup Effective index generation for technical...

  • 6.3 Information Units
    Documenting Python Previous: 6.2 Meta-information Markup Up: 6 Special Markup Constructs Next: 6.4 Showing Code Examples 6.3 Information Units XXX Explain terminology, or come up with something more...

  • 6.5 Inline Markup
    Documenting Python Previous: 6.4 Showing Code Examples Up: 6 Special Markup Constructs Next: 6.6 Miscellaneous Text Markup 6.5 Inline Markup The macros described in this section are used to mark just...

  • 4.3 Common Environments
    Documenting Python Previous: 4.2 Hierarchical Structure Up: 4 LaTeX Primer Next: 5 Document Classes 4.3 Common Environments LaTeX provides a variety of environments even without the additional markup...

  • 4 LaTeX Primer
    Documenting Python Previous: 3 Style Guide Up: Documenting Python Next: 4.1 Syntax 4 LaTeX Primer This section is a brief introduction to LaTeX concepts and syntax, to provide authors enough...

  • 4.2 Hierarchical Structure
    Documenting Python Previous: 4.1 Syntax Up: 4 LaTeX Primer Next: 4.3 Common Environments 4.2 Hierarchical Structure LaTeX expects documents to be arranged in a conventional, hierarchical way, with...

  • 4.1 Syntax
    Documenting Python Previous: 4 LaTeX Primer Up: 4 LaTeX Primer Next: 4.2 Hierarchical Structure 4.1 Syntax There are some things that an author of Python documentation needs to know about LaTeX...

  • 6.8 Library-level Markup
    Documenting Python Previous: 6.7 Module-specific Markup Up: 6 Special Markup Constructs Next: 6.9 Table Markup 6.8 Library-level Markup This markup is used when describing a selection of modules. For...

  • 6.2 Meta-information Markup
    Documenting Python Previous: 6.1 Markup for the Up: 6 Special Markup Constructs Next: 6.3 Information Units 6.2 Meta-information Markup \sectionauthor { author } { email } Identifies the author of...

  • 6.6 Miscellaneous Text Markup
    Documenting Python Previous: 6.5 Inline Markup Up: 6 Special Markup Constructs Next: 6.7 Module-specific Markup 6.6 Miscellaneous Text Markup In addition to the inline markup, some additional...

  • 6.7 Module-specific Markup
    Documenting Python Previous: 6.6 Miscellaneous Text Markup Up: 6 Special Markup Constructs Next: 6.8 Library-level Markup 6.7 Module-specific Markup The markup described in this section is used to...

  • 6.1 Markup for the Preamble
    Documenting Python Previous: 6 Special Markup Constructs Up: 6 Special Markup Constructs Next: 6.2 Meta-information Markup 6.1 Markup for the Preamble \release { ver } Set the version number for the...

  • 6.10 Reference List Markup
    Documenting Python Previous: 6.9 Table Markup Up: 6 Special Markup Constructs Next: 6.11 Index-generating Markup 6.10 Reference List Markup Many sections include a list of references to module...

  • 6.4 Showing Code Examples
    Documenting Python Previous: 6.3 Information Units Up: 6 Special Markup Constructs Next: 6.5 Inline Markup 6.4 Showing Code Examples Examples of Python source code or interactive sessions are...

  • 6 Special Markup Constructs
    Documenting Python Previous: 5 Document Classes Up: Documenting Python Next: 6.1 Markup for the 6 Special Markup Constructs The Python document classes define a lot of new environments and macros....

  • 9.1 Structured Documentation
    Documenting Python Previous: 9 Future Directions Up: 9 Future Directions Next: 9.2 Discussion Forums 9.1 Structured Documentation Most of the small changes to the LaTeX markup have been made with an...

  • 3 Style Guide
    Documenting Python Previous: 2 Directory Structure Up: Documenting Python Next: 4 LaTeX Primer 3 Style Guide The Python documentation should follow the Apple Publications Style Guide wherever...

  • 6.9 Table Markup
    Documenting Python Previous: 6.8 Library-level Markup Up: 6 Special Markup Constructs Next: 6.10 Reference List Markup 6.9 Table Markup There are three general-purpose table environments defined...

  • 7 Processing Tools
    Documenting Python Previous: 6.13 Graphical Interface Components Up: Documenting Python Next: 7.1 External Tools 7 Processing Tools Subsections 7.1 External Tools 7.2 Internal Tools 7.3 Working on...

  • 7.1 External Tools
    Documenting Python Previous: 7 Processing Tools Up: 7 Processing Tools Next: 7.2 Internal Tools 7.1 External Tools Many tools are needed to be able to process the Python documentation if all...

  • 7.2 Internal Tools
    Documenting Python Previous: 7.1 External Tools Up: 7 Processing Tools Next: 7.3 Working on Cygwin 7.2 Internal Tools This section describes the various scripts that are used to implement various...

  • 1.3 Back to the Example
    Extending and Embedding the Python Interpreter Previous: 1.2 Intermezzo: Errors and Up: 1. Extending Python with Next: 1.4 The Module's Method 1.3 Back to the Example Going back to our example...

  • 3. Building C and C++ Extensions with distutils
    Extending and Embedding the Python Interpreter Previous: 2.2.7 More Suggestions Up: Extending and Embedding the Next: 3.1 Distributing your extension 3. Building C and C++ Extensions with distutils...

  • 4. Building C and C++ Extensions on Windows
    Extending and Embedding the Python Interpreter Previous: 3.1 Distributing your extension Up: Extending and Embedding the Next: 4.1 A Cookbook Approach 4. Building C and C++ Extensions on Windows This...

  • 1.9 Building Arbitrary Values
    Extending and Embedding the Python Interpreter Previous: 1.8 Keyword Parameters for Up: 1. Extending Python with Next: 1.10 Reference Counts 1.9 Building Arbitrary Values This function is the...

  • 1.6 Calling Python Functions from C
    Extending and Embedding the Python Interpreter Previous: 1.5 Compilation and Linkage Up: 1. Extending Python with Next: 1.7 Extracting Parameters in 1.6 Calling Python Functions from C So far we have...

  • 1.5 Compilation and Linkage
    Extending and Embedding the Python Interpreter Previous: 1.4 The Module's Method Up: 1. Extending Python with Next: 1.6 Calling Python Functions 1.5 Compilation and Linkage There are two more things...

  • 1.11 Writing Extensions in C++
    Extending and Embedding the Python Interpreter Previous: 1.10.4 NULL Pointers Up: 1. Extending Python with Next: 1.12 Providing a C 1.11 Writing Extensions in C++ It is possible to write extension...

  • 2. Defining New Types
    Extending and Embedding the Python Interpreter Previous: 1.12 Providing a C Up: Extending and Embedding the Next: 2.1 The Basics 2. Defining New Types As mentioned in the last chapter, Python allows...

  • 3.1 Distributing your extension modules
    Extending and Embedding the Python Interpreter Previous: 3. Building C and Up: 3. Building C and Next: 4. Building C and 3.1 Distributing your extension modules When an extension has been...

  • 2.1 The Basics
    Extending and Embedding the Python Interpreter Previous: 2. Defining New Types Up: 2. Defining New Types Next: 2.1.1 Adding data and 2.1 The Basics The Python runtime sees all Python objects as...

  • 2.2 Type Methods
    Extending and Embedding the Python Interpreter Previous: 2.1.3 Supporting cyclic garbage Up: 2. Defining New Types Next: 2.2.1 Finalization and De-allocation 2.2 Type Methods This section aims to...

  • 4.2 Differences Between Unix and Windows
    Extending and Embedding the Python Interpreter Previous: 4.1 A Cookbook Approach Up: 4. Building C and Next: 4.3 Using DLLs in 4.2 Differences Between Unix and Windows Unix and Windows use completely...

  • 5.5 Embedding Python in C++
    Extending and Embedding the Python Interpreter Previous: 5.4 Extending Embedded Python Up: 5. Embedding Python in Next: 5.6 Linking Requirements 5.5 Embedding Python in C++ It is also possible to...

  • 1.2 Intermezzo: Errors and Exceptions
    Extending and Embedding the Python Interpreter Previous: 1.1 A Simple Example Up: 1. Extending Python with Next: 1.3 Back to the 1.2 Intermezzo: Errors and Exceptions An important convention...

  • Extending and Embedding the Python Interpreter
    Extending and Embedding the Python Interpreter Up: Python Documentation Index Next: Front Matter Extending and Embedding the Python Interpreter Guido van Rossum Python Software Foundation Email:...

  • 5.4 Extending Embedded Python
    Extending and Embedding the Python Interpreter Previous: 5.3 Pure Embedding Up: 5. Embedding Python in Next: 5.5 Embedding Python in 5.4 Extending Embedded Python Until now, the embedded Python...

  • 5.1 Very High Level Embedding
    Extending and Embedding the Python Interpreter Previous: 5. Embedding Python in Up: 5. Embedding Python in Next: 5.2 Beyond Very High 5.1 Very High Level Embedding The simplest form of embedding...

  • 5.6 Linking Requirements
    Extending and Embedding the Python Interpreter Previous: 5.5 Embedding Python in Up: 5. Embedding Python in Next: A. Reporting Bugs 5.6 Linking Requirements While the configure script shipped with...

  • 5.2 Beyond Very High Level Embedding: An overview
    Extending and Embedding the Python Interpreter Previous: 5.1 Very High Level Up: 5. Embedding Python in Next: 5.3 Pure Embedding 5.2 Beyond Very High Level Embedding: An overview The high level...

  • 1.4 The Module's Method Table and Initialization Function
    Extending and Embedding the Python Interpreter Previous: 1.3 Back to the Up: 1. Extending Python with Next: 1.5 Compilation and Linkage 1.4 The Module's Method Table and Initialization Function I...

  • noddy
    #include typedef struct { PyObject_HEAD /* Type-specific fields go here. */ } noddy_NoddyObject; static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "noddy.Noddy",...

  • noddy2
    #include #include "structmember.h" typedef struct { PyObject_HEAD PyObject *first; /* first name */ PyObject *last; /* last name */ int number; } Noddy; static void Noddy_dealloc(Noddy* self) {...

  • noddy3
    #include #include "structmember.h" typedef struct { PyObject_HEAD PyObject *first; PyObject *last; int number; } Noddy; static void Noddy_dealloc(Noddy* self) { Py_XDECREF(self->first);...

  • noddy4
    #include #include "structmember.h" typedef struct { PyObject_HEAD PyObject *first; PyObject *last; int number; } Noddy; static int Noddy_traverse(Noddy *self, visitproc visit, void *arg) { int vret;...

  • 2.1.1 Adding data and methods to the Basic example
    Extending and Embedding the Python Interpreter Previous: 2.1 The Basics Up: 2.1 The Basics Next: 2.1.2 Providing finer control 2.1.1 Adding data and methods to the Basic example Let's expend the...

  • 2.1.2 Providing finer control over data attributes
    Extending and Embedding the Python Interpreter Previous: 2.1.1 Adding data and Up: 2.1 The Basics Next: 2.1.3 Supporting cyclic garbage 2.1.2 Providing finer control over data attributes In this...

  • 2.1.3 Supporting cyclic garbage collection
    Extending and Embedding the Python Interpreter Previous: 2.1.2 Providing finer control Up: 2.1 The Basics Next: 2.2 Type Methods 2.1.3 Supporting cyclic garbage collection Python has a cyclic-garbage...

  • 2.2.1 Finalization and De-allocation
    Extending and Embedding the Python Interpreter Previous: 2.2 Type Methods Up: 2.2 Type Methods Next: 2.2.2 Object Presentation 2.2.1 Finalization and De-allocation destructor tp_dealloc; This...

  • 2.2.2 Object Presentation
    Extending and Embedding the Python Interpreter Previous: 2.2.1 Finalization and De-allocation Up: 2.2 Type Methods Next: 2.2.3 Attribute Management 2.2.2 Object Presentation In Python, there are...

  • 2.2.3 Attribute Management
    Extending and Embedding the Python Interpreter Previous: 2.2.2 Object Presentation Up: 2.2 Type Methods Next: 2.2.3.1 Generic Attribute Management 2.2.3 Attribute Management For every object which...

  • 2.2.3.1 Generic Attribute Management
    Extending and Embedding the Python Interpreter Previous: 2.2.3 Attribute Management Up: 2.2.3 Attribute Management Next: 2.2.3.2 Type-specific Attribute Management 2.2.3.1 Generic Attribute...

  • 2.2.3.2 Type-specific Attribute Management
    Extending and Embedding the Python Interpreter Previous: 2.2.3.1 Generic Attribute Management Up: 2.2.3 Attribute Management Next: 2.2.4 Object Comparison 2.2.3.2 Type-specific Attribute Management...

  • 2.2.4 Object Comparison
    Extending and Embedding the Python Interpreter Previous: 2.2.3.2 Type-specific Attribute Management Up: 2.2 Type Methods Next: 2.2.5 Abstract Protocol Support 2.2.4 Object Comparison cmpfunc...

  • 2.2.7 More Suggestions
    Extending and Embedding the Python Interpreter Previous: 2.2.6 Weak Reference Support Up: 2.2 Type Methods Next: 3. Building C and 2.2.7 More Suggestions Remember that you can omit most of these...

  • B. History and License
    Extending and Embedding the Python Interpreter Previous: A. Reporting Bugs Up: Extending and Embedding the Next: B.1 History of the B. History and License Subsections B.1 History of the software B.2...

  • B.1 History of the software
    Extending and Embedding the Python Interpreter Previous: B. History and License Up: B. History and License Next: B.2 Terms and conditions B.1 History of the software Python was created in the early...

  • B.2 Terms and conditions for accessing or otherwise using Python
    Extending and Embedding the Python Interpreter Previous: B.1 History of the Up: B. History and License Next: B.3 Licenses and Acknowledgements B.2 Terms and conditions for accessing or otherwise...

  • B.3 Licenses and Acknowledgements for Incorporated Software
    Extending and Embedding the Python Interpreter Previous: B.2 Terms and conditions Up: B. History and License Next: B.3.1 Mersenne Twister B.3 Licenses and Acknowledgements for Incorporated Software...

  • B.3.1 Mersenne Twister
    Extending and Embedding the Python Interpreter Previous: B.3 Licenses and Acknowledgements Up: B.3 Licenses and Acknowledgements Next: B.3.2 Sockets B.3.1 Mersenne Twister The _random module includes...

  • B.3.2 Sockets
    Extending and Embedding the Python Interpreter Previous: B.3.1 Mersenne Twister Up: B.3 Licenses and Acknowledgements Next: B.3.3 Floating point exception B.3.2 Sockets The socket module uses the...

  • B.3.3 Floating point exception control
    Extending and Embedding the Python Interpreter Previous: B.3.2 Sockets Up: B.3 Licenses and Acknowledgements Next: B.3.4 MD5 message digest B.3.3 Floating point exception control The source for the...

  • B.3.4 MD5 message digest algorithm
    Extending and Embedding the Python Interpreter Previous: B.3.3 Floating point exception Up: B.3 Licenses and Acknowledgements Next: B.3.5 Asynchronous socket services B.3.4 MD5 message digest...

  • B.3.5 Asynchronous socket services
    Extending and Embedding the Python Interpreter Previous: B.3.4 MD5 message digest Up: B.3 Licenses and Acknowledgements Next: B.3.6 Cookie management B.3.5 Asynchronous socket services The asynchat...

  • B.3.6 Cookie management
    Extending and Embedding the Python Interpreter Previous: B.3.5 Asynchronous socket services Up: B.3 Licenses and Acknowledgements Next: B.3.7 Profiling B.3.6 Cookie management The Cookie module...

  • B.3.7 Profiling
    Extending and Embedding the Python Interpreter Previous: B.3.6 Cookie management Up: B.3 Licenses and Acknowledgements Next: B.3.8 Execution tracing B.3.7 Profiling The profile and pstats modules...

  • B.3.8 Execution tracing
    Extending and Embedding the Python Interpreter Previous: B.3.7 Profiling Up: B.3 Licenses and Acknowledgements Next: B.3.9 UUencode and UUdecode B.3.8 Execution tracing The trace module contains the...

  • B.3.9 UUencode and UUdecode functions
    Extending and Embedding the Python Interpreter Previous: B.3.8 Execution tracing Up: B.3 Licenses and Acknowledgements Next: B.3.10 XML Remote Procedure B.3.9 UUencode and UUdecode functions The uu...

  • B.3.10 XML Remote Procedure Calls
    Extending and Embedding the Python Interpreter Previous: B.3.9 UUencode and UUdecode Up: B.3 Licenses and Acknowledgements Next: About this document ... B.3.10 XML Remote Procedure Calls The...

  • 1.10.4 NULL Pointers
    Extending and Embedding the Python Interpreter Previous: 1.10.3 Thin Ice Up: 1.10 Reference Counts Next: 1.11 Writing Extensions in 1.10.4 NULL Pointers In general, functions that take object...

  • 1.10.2 Ownership Rules
    Extending and Embedding the Python Interpreter Previous: 1.10.1 Reference Counting in Up: 1.10 Reference Counts Next: 1.10.3 Thin Ice 1.10.2 Ownership Rules Whenever an object reference is passed...

  • 1.7 Extracting Parameters in Extension Functions
    Extending and Embedding the Python Interpreter Previous: 1.6 Calling Python Functions Up: 1. Extending Python with Next: 1.8 Keyword Parameters for 1.7 Extracting Parameters in Extension Functions...

  • 1.8 Keyword Parameters for Extension Functions
    Extending and Embedding the Python Interpreter Previous: 1.7 Extracting Parameters in Up: 1. Extending Python with Next: 1.9 Building Arbitrary Values 1.8 Keyword Parameters for Extension Functions...

  • 5.3 Pure Embedding
    Extending and Embedding the Python Interpreter Previous: 5.2 Beyond Very High Up: 5. Embedding Python in Next: 5.4 Extending Embedded Python 5.3 Pure Embedding The first program aims to execute a...

  • 1.10.1 Reference Counting in Python
    Extending and Embedding the Python Interpreter Previous: 1.10 Reference Counts Up: 1.10 Reference Counts Next: 1.10.2 Ownership Rules 1.10.1 Reference Counting in Python There are two macros,...

  • run func
    #include int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc; PyObject *pArgs, *pValue; int i; if (argc < 3) { fprintf(stderr,"Usage: call pythonfile funcname [args]\n");...

  • 1.1 A Simple Example
    Extending and Embedding the Python Interpreter Previous: 1. Extending Python with Up: 1. Extending Python with Next: 1.2 Intermezzo: Errors and 1.1 A Simple Example Let's create an extension module...

  • 1.10.3 Thin Ice
    Extending and Embedding the Python Interpreter Previous: 1.10.2 Ownership Rules Up: 1.10 Reference Counts Next: 1.10.4 NULL Pointers 1.10.3 Thin Ice There are a few situations where seemingly...

  • 1.12 Providing a C API for an Extension Module
    Extending and Embedding the Python Interpreter Previous: 1.11 Writing Extensions in Up: 1. Extending Python with Next: 2. Defining New Types 1.12 Providing a C API for an Extension Module Many...

  • 2.2.6 Weak Reference Support
    Extending and Embedding the Python Interpreter Previous: 2.2.5 Abstract Protocol Support Up: 2.2 Type Methods Next: 2.2.7 More Suggestions 2.2.6 Weak Reference Support One of the goals of Python's...

  • 4.1 A Cookbook Approach
    Extending and Embedding the Python Interpreter Previous: 4. Building C and Up: 4. Building C and Next: 4.2 Differences Between Unix 4.1 A Cookbook Approach There are two approaches to building...

  • 4.3 Using DLLs in Practice
    Extending and Embedding the Python Interpreter Previous: 4.2 Differences Between Unix Up: 4. Building C and Next: 5. Embedding Python in 4.3 Using DLLs in Practice Windows Python is built in...

  • 3 Alternate Installation
    Installing Python Modules Previous: 2 Standard Build and Up: Installing Python Modules Next: 4 Custom Installation Subsections 3.1 Alternate installation: the home scheme 3.2 Alternate installation:...

  • 5 Distutils Configuration Files
    Installing Python Modules Previous: 4 Custom Installation Up: Installing Python Modules Next: 6 Building Extensions: Tips Subsections 5.1 Location and names of config files 5.2 Syntax of config files...

  • Installing Python Modules
    Installing Python Modules Up: Python Documentation Index Next: 1 Introduction Installing Python Modules Greg Ward Python Software Foundation Email: distutils-sig@python.org Release 2.5 19th...

  • 4 Custom Installation
    Installing Python Modules Previous: 3 Alternate Installation Up: Installing Python Modules Next: 5 Distutils Configuration Files Subsections 4.1 Modifying Python's Search Path 4 Custom Installation...

  • 2 Standard Build and Install
    Installing Python Modules Previous: 1 Introduction Up: Installing Python Modules Next: 3 Alternate Installation Subsections 2.1 Platform variations 2.2 Splitting the job up 2.3 How building works 2.4...

  • 1 Introduction
    Installing Python Modules Previous: Installing Python Modules Up: Installing Python Modules Next: 2 Standard Build and Subsections 1.1 Best case: trivial installation 1.2 The new standard: Distutils...

  • 6 Building Extensions: Tips and Tricks
    Installing Python Modules Previous: 5 Distutils Configuration Files Up: Installing Python Modules Next: About this document ... Subsections 6.1 Tweaking compiler/linker flags 6.2 Using non-Microsoft...

  • 18.6.8 AbstractBasicAuthHandler Objects
    Python Library Reference Previous: 18.6.7 HTTPPasswordMgr Objects Up: 18.6 urllib2 Next: 18.6.9 HTTPBasicAuthHandler Objects 18.6.8 AbstractBasicAuthHandler Objects http_error_auth_reqed ( authreq,...

  • 18.6.11 AbstractDigestAuthHandler Objects
    Python Library Reference Previous: 18.6.10 ProxyBasicAuthHandler Objects Up: 18.6 urllib2 Next: 18.6.12 HTTPDigestAuthHandler Objects 18.6.11 AbstractDigestAuthHandler Objects http_error_auth_reqed (...

  • adapter datetime
    import sqlite3 import datetime, time def adapt_datetime(ts): return time.mktime(ts.timetuple()) sqlite3.register_adapter(datetime.datetime, adapt_datetime) con = sqlite3.connect(":memory:") cur =...

  • adapter point 1
    import sqlite3 class Point(object): def __init__(self, x, y): self.x, self.y = x, y def __conform__(self, protocol): if protocol is sqlite3.PrepareProtocol: return "%f;%f" % (self.x, self.y) con =...

  • adapter point 2
    import sqlite3 class Point(object): def __init__(self, x, y): self.x, self.y = x, y def adapt_point(point): return "%f;%f" % (point.x, point.y) sqlite3.register_adapter(Point, adapt_point) con =...

  • 7.10.2 AddressList Objects
    Python Library Reference Previous: 7.10.1 Message Objects Up: 7.10 rfc822 Next: 7.11 base64 7.10.2 AddressList Objects An AddressList instance has the following methods: __len__ ( ) Return the number...

  • 34.1.1 Configuration Objects
    Python Library Reference Previous: 34.1 al Up: 34.1 al Next: 34.1.2 Port Objects 34.1.1 Configuration Objects Configuration objects returned by newconfig() have the following methods: getqueuesize (...

  • 14. Generic Operating System Services
    Python Library Reference Previous: 13.13.6.2 Accessing columns by Up: Python Library Reference Next: 14.1 os 14. Generic Operating System Services The modules described in this chapter provide...

  • 34.1.2 Port Objects
    Python Library Reference Previous: 34.1.1 Configuration Objects Up: 34.1 al Next: 34.2 AL 34.1.2 Port Objects Port objects, as returned by openport() , have the following methods: closeport ( ) Close...

  • 12. Data Compression and Archiving
    Python Library Reference Previous: 11.11 dircache Up: Python Library Reference Next: 12.1 zlib 12. Data Compression and Archiving The modules described in this chapter support data compression with...

  • 32. Abstract Syntax Trees
    Python Library Reference Previous: 31.5 Bytecode Generation Up: Python Library Reference Next: 32.1 Abstract Grammar 32. Abstract Syntax Trees New in version 2.5. The _ast module helps Python...

  • 17.6.2 asynchat Example
    Python Library Reference Previous: 17.6.1 asynchat - Auxiliary Up: 17.6 asynchat Next: 18. Internet Protocols and 17.6.2 asynchat Example The following partial example shows how HTTP requests can be...

  • 17.5.1 asyncore Example basic HTTP client
    Python Library Reference Previous: 17.5 asyncore Up: 17.5 asyncore Next: 17.6 asynchat 17.5.1 asyncore Example basic HTTP client Here is a very basic HTTP client that uses the dispatcher class to...

  • 26.6.1 atexit Example
    Python Library Reference Previous: 26.6 atexit Up: 26.6 atexit Next: 26.7 traceback 26.6.1 atexit Example The following simple example demonstrates how a module can initialize a counter from a file...

  • 8.12.6 The AttributesNS Interface
    Python Library Reference Previous: 8.12.5 The Attributes Interface Up: 8.12 xml.sax.xmlreader Next: 8.13 xml.etree.ElementTree 8.12.6 The AttributesNS Interface This interface is a subtype of the...

  • 8.12.5 The Attributes Interface
    Python Library Reference Previous: 8.12.4 InputSource Objects Up: 8.12 xml.sax.xmlreader Next: 8.12.6 The AttributesNS Interface 8.12.5 The Attributes Interface Attributes objects implement a portion...

  • 35.1.1 Audio Device Objects
    Python Library Reference Previous: 35.1 sunaudiodev Up: 35.1 sunaudiodev Next: 35.2 SUNAUDIODEV 35.1.1 Audio Device Objects The audio device objects are returned by open() define the following...

  • 19.4.1 AU_read Objects
    Python Library Reference Previous: 19.4 sunau Up: 19.4 sunau Next: 19.4.2 AU_write Objects 19.4.1 AU_read Objects AU_read objects, as returned by open() above, have the following methods: close ( )...

  • 19.4.2 AU_write Objects
    Python Library Reference Previous: 19.4.1 AU_read Objects Up: 19.4 sunau Next: 19.5 wave 19.4.2 AU_write Objects AU_write objects, as returned by open() above, have the following methods:...

  • 18.6.3 BaseHandler Objects
    Python Library Reference Previous: 18.6.2 OpenerDirector Objects Up: 18.6 urllib2 Next: 18.6.4 HTTPRedirectHandler Objects 18.6.3 BaseHandler Objects BaseHandler objects provide a couple of methods...

  • 18.24.4 Binary Objects
    Python Library Reference Previous: 18.24.3 DateTime Objects Up: 18.24 xmlrpclib Next: 18.24.5 Fault Objects 18.24.4 Binary Objects This class may be initialized from string data (which may include...

  • 7.12.1 Notes
    Python Library Reference Previous: 7.12 binhex Up: 7.12 binhex Next: 7.13 binascii 7.12.1 Notes There is an alternative, more powerful interface to the coder and decoder, see the source for details....

  • 5.5.1 Examples
    Python Library Reference Previous: 5.5 bisect Up: 5.5 bisect Next: 5.6 array 5.5.1 Examples The bisect() function is generally useful for categorizing numeric data. This example uses bisect() to look...

  • 3.4.1 Bit-string Operations on Integer Types
    Python Library Reference Previous: 3.4 Numeric Types Up: 3.4 Numeric Types Next: 3.5 Iterator Types 3.4.1 Bit-string Operations on Integer Types Plain and long integer types support additional...

  • 3.11.5 Code Objects
    Python Library Reference Previous: 3.11.4 Methods Up: 3.11 Other Built-in Types Next: 3.11.6 Type Objects 3.11.5 Code Objects Code objects are used by the implementation to represent...

  • 3.11.8 The Ellipsis Object
    Python Library Reference Previous: 3.11.7 The Null Object Up: 3.11 Other Built-in Types Next: 3.11.9 Boolean Values 3.11.8 The Ellipsis Object This object is used by extended slice notation (see the...

  • 3.9 File Objects
    Python Library Reference Previous: 3.8 Mapping Types Up: 3. Built-in Types Next: 3.10 Context Manager Types 3.9 File Objects File objects are implemented using C's stdio package and can be created...

  • 3.11.7 The Null Object
    Python Library Reference Previous: 3.11.6 Type Objects Up: 3.11 Other Built-in Types Next: 3.11.8 The Ellipsis Object 3.11.7 The Null Object This object is returned by functions that don't explicitly...

  • 3.11.6 Type Objects
    Python Library Reference Previous: 3.11.5 Code Objects Up: 3.11 Other Built-in Types Next: 3.11.7 The Null Object 3.11.6 Type Objects Type objects represent the various object types. An object's type...

  • 3.2 Boolean Operations -- and, or, not
    Python Library Reference Previous: 3.1 Truth Value Testing Up: 3. Built-in Types Next: 3.3 Comparisons 3.2 Boolean Operations -- and , or , not These are the Boolean operations, ordered by ascending...

  • 18.24.2 Boolean Objects
    Python Library Reference Previous: 18.24.1 ServerProxy Objects Up: 18.24 xmlrpclib Next: 18.24.3 DateTime Objects 18.24.2 Boolean Objects This class may be initialized from any Python value; the...

  • 18.1.1 Browser Controller Objects
    Python Library Reference Previous: 18.1 webbrowser Up: 18.1 webbrowser Next: 18.2 cgi 18.1.1 Browser Controller Objects Browser controllers provide two methods which parallel two of the module-level...

  • 13.11.1 Hash, BTree and Record Objects
    Python Library Reference Previous: 13.11 bsddb Up: 13.11 bsddb Next: 13.12 dumbdbm 13.11.1 Hash, BTree and Record Objects Once instantiated, hash, btree and record objects support the same methods as...

  • 2. Built-in Objects
    Python Library Reference Previous: 1. Introduction Up: Python Library Reference Next: 2.1 Built-in Functions 2. Built-in Objects Names for built-in exceptions and functions and a number of constants...

  • 2.1 Built-in Functions
    Python Library Reference Previous: 2. Built-in Objects Up: 2. Built-in Objects Next: 2.2 Non-essential Built-in Functions 2.1 Built-in Functions The Python interpreter has a number of functions built...

  • 30.10.1 Python Byte Code Instructions
    Python Library Reference Previous: 30.10 dis Up: 30.10 dis Next: 30.11 pickletools 30.10.1 Python Byte Code Instructions The Python compiler currently generates the following byte code instructions....

  • 36.1.6 CAB Objects
    Python Library Reference Previous: 36.1.5 Errors Up: 36.1 msilib Next: 36.1.7 Directory Objects 36.1.6 CAB Objects class   CAB ( name ) The class CAB represents a CAB file. During MSI...

  • 18.6.18 CacheFTPHandler Objects
    Python Library Reference Previous: 18.6.17 FTPHandler Objects Up: 18.6 urllib2 Next: 18.6.19 GopherHandler Objects 18.6.18 CacheFTPHandler Objects CacheFTPHandler objects are FTPHandler objects with...

  • 34.3.2 Parser Objects
    Python Library Reference Previous: 34.3.1 Player Objects Up: 34.3 cd Next: 34.4 fl 34.3.2 Parser Objects Parser objects (returned by createparser() ) have the following methods: addcallback ( type,...

  • 18.2.1 Introduction
    Python Library Reference Previous: 18.2 cgi Up: 18.2 cgi Next: 18.2.2 Using the cgi 18.2.1 Introduction A CGI script is invoked by an HTTP server, usually to process user input submitted through an...

  • 18.2.6 Caring about security
    Python Library Reference Previous: 18.2.5 Functions Up: 18.2 cgi Next: 18.2.7 Installing your CGI 18.2.6 Caring about security There's one important rule: if you invoke an external program (via the...

  • 22.1.1 Cmd Objects
    Python Library Reference Previous: 22.1 cmd Up: 22.1 cmd Next: 22.2 shlex 22.1.1 Cmd Objects A Cmd instance has the following methods: cmdloop ( [ intro ] ) Repeatedly issue a prompt, accept input,...

  • 4.8.1 Codec Base Classes
    Python Library Reference Previous: 4.8 codecs Up: 4.8 codecs Next: 4.8.1.1 Codec Objects 4.8.1 Codec Base Classes The codecs module defines a set of base classes which define the interface and can...

  • 4.8.1.1 Codec Objects
    Python Library Reference Previous: 4.8.1 Codec Base Classes Up: 4.8.1 Codec Base Classes Next: 4.8.1.2 IncrementalEncoder Objects 4.8.1.1 Codec Objects The Codec class defines these methods which...

  • collation reverse
    import sqlite3 def collate_reverse(string1, string2): return -cmp(string1, string2) con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse) cur = con.cursor()...

  • 3.3 Comparisons
    Python Library Reference Previous: 3.2 Boolean Operations Up: 3. Built-in Types Next: 3.4 Numeric Types 3.3 Comparisons Comparison operations are supported by all objects. They all have the same...

  • 5.7.4 Comparison to the built-in set types
    Python Library Reference Previous: 5.7.3 Protocol for automatic Up: 5.7 sets Next: 5.8 sched 5.7.4 Comparison to the built-in set types The built-in set and frozenset types were designed based on...

  • 31. Python compiler package
    Python Library Reference Previous: 30.12 distutils Up: Python Library Reference Next: 31.1 The basic interface 31. Python compiler package The Python compiler package is a tool for analyzing Python...

  • complete statement
    # A minimal SQLite shell for experiments import sqlite3 con = sqlite3.connect(":memory:") con.isolation_level = None cur = con.cursor() buffer = "" print "Enter your SQL commands to execute in...

  • 15.8.1 Completer Objects
    Python Library Reference Previous: 15.8 rlcompleter Up: 15.8 rlcompleter Next: 16. Unix Specific Services 15.8.1 Completer Objects Completer objects have the following method: complete ( text, state...

  • 15.3.3 Condition Objects
    Python Library Reference Previous: 15.3.2 RLock Objects Up: 15.3 threading Next: 15.3.4 Semaphore Objects 15.3.3 Condition Objects A condition variable is always associated with some kind of lock;...

  • 9.2.2 ConfigParser Objects
    Python Library Reference Previous: 9.2.1 RawConfigParser Objects Up: 9.2 ConfigParser Next: 9.2.3 SafeConfigParser Objects 9.2.2 ConfigParser Objects The ConfigParser class extends some methods of...

  • 27.1.2 Interactive Console Objects
    Python Library Reference Previous: 27.1.1 Interactive Interpreter Objects Up: 27.1 code Next: 27.2 codeop 27.1.2 Interactive Console Objects The InteractiveConsole class is a subclass of...

  • 8.10.1 ContentHandler Objects
    Python Library Reference Previous: 8.10 xml.sax.handler Up: 8.10 xml.sax.handler Next: 8.10.2 DTDHandler Objects 8.10.1 ContentHandler Objects Users are expected to subclass ContentHandler to support...

  • converter point
    import sqlite3 class Point(object): def __init__(self, x, y): self.x, self.y = x, y def __repr__(self): return "(%f;%f)" % (self.x, self.y) def adapt_point(point): return "%f;%f" % (point.x, point.y)...

  • 18.23.3 Example
    Python Library Reference Previous: 18.23.2 Morsel Objects Up: 18.23 Cookie Next: 18.24 xmlrpclib 18.23.3 Example The following example demonstrates how to use the Cookie module. >>> import...

  • 18.22.1 CookieJar and FileCookieJar Objects
    Python Library Reference Previous: 18.22 cookielib Up: 18.22 cookielib Next: 18.22.2 FileCookieJar subclasses and 18.22.1 CookieJar and FileCookieJar Objects CookieJar objects support the iterator...

  • 18.22.6 Examples
    Python Library Reference Previous: 18.22.5 Cookie Objects Up: 18.22 cookielib Next: 18.23 Cookie 18.22.6 Examples The first example shows the most common usage of cookielib : import cookielib,...

  • 18.23.1 Cookie Objects
    Python Library Reference Previous: 18.23 Cookie Up: 18.23 Cookie Next: 18.23.2 Morsel Objects 18.23.1 Cookie Objects value_decode ( val ) Return a decoded value from a string representation. Return...

  • 18.22.3 CookiePolicy Objects
    Python Library Reference Previous: 18.22.2 FileCookieJar subclasses and Up: 18.22 cookielib Next: 18.22.4 DefaultCookiePolicy Objects 18.22.3 CookiePolicy Objects Objects implementing the...

  • 10. Cryptographic Services
    Python Library Reference Previous: 9.5.3 Exceptions Up: Python Library Reference Next: 10.1 hashlib 10. Cryptographic Services The modules described in this chapter implement various algorithms of a...

  • 9.1.1 Module Contents
    Python Library Reference Previous: 9.1 csv Up: 9.1 csv Next: 9.1.2 Dialects and Formatting 9.1.1 Module Contents The csv module defines the following functions: reader ( csvfile [ , dialect= 'excel'...

  • 9.1.5 Examples
    Python Library Reference Previous: 9.1.4 Writer Objects Up: 9.1 csv Next: 9.2 ConfigParser 9.1.5 Examples The simplest example of reading a CSV file: import csv reader = csv.reader(open("some.csv",...

  • 9.1.2 Dialects and Formatting Parameters
    Python Library Reference Previous: 9.1.1 Module Contents Up: 9.1 csv Next: 9.1.3 Reader Objects 9.1.2 Dialects and Formatting Parameters To make it easier to specify the format of input and output...

  • 14.14.1.2 Accessing functions from loaded dlls
    Python Library Reference Previous: 14.14.1.1 Loading dynamic link Up: 14.14.1 ctypes tutorial Next: 14.14.1.3 Calling functions 14.14.1.2 Accessing functions from loaded dlls Functions are accessed...

  • 14.14.1.18 Accessing values exported from dlls
    Python Library Reference Previous: 14.14.1.17 Callback functions Up: 14.14.1 ctypes tutorial Next: 14.14.1.19 Surprises 14.14.1.18 Accessing values exported from dlls Sometimes, a dll not only...

  • 14.14.1.13 Arrays
    Python Library Reference Previous: 14.14.1.12 Bit fields in Up: 14.14.1 ctypes tutorial Next: 14.14.1.14 Pointers 14.14.1.13 Arrays Arrays are sequences, containing a fixed number of instances of the...

  • 14.14.2.9 Arrays and pointers
    Python Library Reference Previous: 14.14.2.8 Structured data types Up: 14.14.2 ctypes reference Next: 15. Optional Operating System 14.14.2.9 Arrays and pointers XXX Python Library Reference...

  • 14.14.1.12 Bit fields in structures and unions
    Python Library Reference Previous: 14.14.1.11 Structure/union alignment and Up: 14.14.1 ctypes tutorial Next: 14.14.1.13 Arrays 14.14.1.12 Bit fields in structures and unions It is possible to create...

  • 14.14.1.21 Bugs, ToDo and non-implemented things
    Python Library Reference Previous: 14.14.1.20 Variable-sized data types Up: 14.14.1 ctypes tutorial Next: 14.14.2 ctypes reference 14.14.1.21 Bugs, ToDo and non-implemented things Enumeration types...

  • 14.14.1.17 Callback functions
    Python Library Reference Previous: 14.14.1.16 Incomplete Types Up: 14.14.1 ctypes tutorial Next: 14.14.1.18 Accessing values exported 14.14.1.17 Callback functions ctypes allows to create C callable...

  • 14.14.1.3 Calling functions
    Python Library Reference Previous: 14.14.1.2 Accessing functions from Up: 14.14.1 ctypes tutorial Next: 14.14.1.4 Fundamental data types 14.14.1.3 Calling functions You can call these functions like...

  • 14.14.1.5 Calling functions, continued
    Python Library Reference Previous: 14.14.1.4 Fundamental data types Up: 14.14.1 ctypes tutorial Next: 14.14.1.6 Calling functions with 14.14.1.5 Calling functions, continued Note that printf prints...

  • 14.14.1.6 Calling functions with your own custom data types
    Python Library Reference Previous: 14.14.1.5 Calling functions, continued Up: 14.14.1 ctypes tutorial Next: 14.14.1.7 Specifying the required 14.14.1.6 Calling functions with your own custom data...

  • 14.14.2 ctypes reference
    Python Library Reference Previous: 14.14.1.21 Bugs, ToDo and Up: 14.14 ctypes Next: 14.14.2.1 Finding shared libraries 14.14.2 ctypes reference Subsections 14.14.2.1 Finding shared libraries...

  • 14.14.1 ctypes tutorial
    Python Library Reference Previous: 14.14 ctypes Up: 14.14 ctypes Next: 14.14.1.1 Loading dynamic link 14.14.1 ctypes tutorial Note: The code samples in this tutorial uses doctest to make sure that...

  • 14.14.2.6 Data types
    Python Library Reference Previous: 14.14.2.5 Utility functions Up: 14.14.2 ctypes reference Next: 14.14.2.7 Fundamental data types 14.14.2.6 Data types class   _CData This non-public class is...

  • 14.14.2.1 Finding shared libraries
    Python Library Reference Previous: 14.14.2 ctypes reference Up: 14.14.2 ctypes reference Next: 14.14.2.2 Loading shared libraries 14.14.2.1 Finding shared libraries When programming in a compiled...

  • 14.14.2.3 Foreign functions
    Python Library Reference Previous: 14.14.2.2 Loading shared libraries Up: 14.14.2 ctypes reference Next: 14.14.2.4 Function prototypes 14.14.2.3 Foreign functions As explained in the previous...

  • 14.14.2.4 Function prototypes
    Python Library Reference Previous: 14.14.2.3 Foreign functions Up: 14.14.2 ctypes reference Next: 14.14.2.5 Utility functions 14.14.2.4 Function prototypes Foreign functions can also be created by...

  • 14.14.2.7 Fundamental data types
    Python Library Reference Previous: 14.14.2.6 Data types Up: 14.14.2 ctypes reference Next: 14.14.2.8 Structured data types 14.14.2.7 Fundamental data types class   _SimpleCData This non-public...

  • 14.14.1.16 Incomplete Types
    Python Library Reference Previous: 14.14.1.15 Type conversions Up: 14.14.1 ctypes tutorial Next: 14.14.1.17 Callback functions 14.14.1.16 Incomplete Types Incomplete Types are structures, unions or...

  • 14.14.1.1 Loading dynamic link libraries
    Python Library Reference Previous: 14.14.1 ctypes tutorial Up: 14.14.1 ctypes tutorial Next: 14.14.1.2 Accessing functions from 14.14.1.1 Loading dynamic link libraries ctypes exports the cdll , and...

  • 14.14.2.2 Loading shared libraries
    Python Library Reference Previous: 14.14.2.1 Finding shared libraries Up: 14.14.2 ctypes reference Next: 14.14.2.3 Foreign functions 14.14.2.2 Loading shared libraries There are several ways to...

  • 14.14.1.9 Passing pointers (or: passing parameters by reference)
    Python Library Reference Previous: 14.14.1.8 Return types Up: 14.14.1 ctypes tutorial Next: 14.14.1.10 Structures and unions 14.14.1.9 Passing pointers (or: passing parameters by reference) Sometimes...

  • 14.14.1.14 Pointers
    Python Library Reference Previous: 14.14.1.13 Arrays Up: 14.14.1 ctypes tutorial Next: 14.14.1.15 Type conversions 14.14.1.14 Pointers Pointer instances are created by calling the pointer function on...

  • 14.14.1.8 Return types
    Python Library Reference Previous: 14.14.1.7 Specifying the required Up: 14.14.1 ctypes tutorial Next: 14.14.1.9 Passing pointers (or: 14.14.1.8 Return types By default functions are assumed to...

  • 14.14.1.7 Specifying the required argument types (function prototypes)
    Python Library Reference Previous: 14.14.1.6 Calling functions with Up: 14.14.1 ctypes tutorial Next: 14.14.1.8 Return types 14.14.1.7 Specifying the required argument types (function prototypes) It...

  • 14.14.2.8 Structured data types
    Python Library Reference Previous: 14.14.2.7 Fundamental data types Up: 14.14.2 ctypes reference Next: 14.14.2.9 Arrays and pointers 14.14.2.8 Structured data types class   Union ( *args, **kw )...

  • 14.14.1.10 Structures and unions
    Python Library Reference Previous: 14.14.1.9 Passing pointers (or: Up: 14.14.1 ctypes tutorial Next: 14.14.1.11 Structure/union alignment and 14.14.1.10 Structures and unions Structures and unions...

  • 14.14.1.11 Structure/union alignment and byte order
    Python Library Reference Previous: 14.14.1.10 Structures and unions Up: 14.14.1 ctypes tutorial Next: 14.14.1.12 Bit fields in 14.14.1.11 Structure/union alignment and byte order By default,...

  • 14.14.1.19 Surprises
    Python Library Reference Previous: 14.14.1.18 Accessing values exported Up: 14.14.1 ctypes tutorial Next: 14.14.1.20 Variable-sized data types 14.14.1.19 Surprises There are some edges in ctypes...

  • 14.14.1.15 Type conversions
    Python Library Reference Previous: 14.14.1.14 Pointers Up: 14.14.1 ctypes tutorial Next: 14.14.1.16 Incomplete Types 14.14.1.15 Type conversions Usually, ctypes does strict type checking. This means,...

  • 14.14.2.5 Utility functions
    Python Library Reference Previous: 14.14.2.4 Function prototypes Up: 14.14.2 ctypes reference Next: 14.14.2.6 Data types 14.14.2.5 Utility functions addressof ( obj ) Returns the address of the...

  • 14.14.1.20 Variable-sized data types
    Python Library Reference Previous: 14.14.1.19 Surprises Up: 14.14.1 ctypes tutorial Next: 14.14.1.21 Bugs, ToDo and 14.14.1.20 Variable-sized data types ctypes provides some support for...

  • 14.7.1 Functions
    Python Library Reference Previous: 14.7 curses Up: 14.7 curses Next: 14.7.2 Window Objects 14.7.1 Functions The module curses defines the following exception: exception   error Exception raised...

  • 14.11.1 Functions
    Python Library Reference Previous: 14.11 curses.panel Up: 14.11 curses.panel Next: 14.11.2 Panel Objects 14.11.1 Functions The module curses.panel defines the following functions: bottom_panel ( )...

  • 14.11.2 Panel Objects
    Python Library Reference Previous: 14.11.1 Functions Up: 14.11 curses.panel Next: 14.12 platform 14.11.2 Panel Objects Panel objects, as returned by new_panel() above, are windows with a stacking...

  • 14.8.1 Textbox objects
    Python Library Reference Previous: 14.8 curses.textpad Up: 14.8 curses.textpad Next: 14.9 curses.wrapper 14.8.1 Textbox objects You can instantiate a Textbox object as follows: class   Textbox (...

  • 14.7.2 Window Objects
    Python Library Reference Previous: 14.7.1 Functions Up: 14.7 curses Next: 14.7.3 Constants 14.7.2 Window Objects Window objects, as returned by initscr() and newwin() above, have the following...

  • 27. Custom Python Interpreters
    Python Library Reference Previous: 26.13.2 Limitations and other Up: Python Library Reference Next: 27.1 code 27. Custom Python Interpreters The modules described in this chapter allow writing...

  • 36.1.1 Database Objects
    Python Library Reference Previous: 36.1 msilib Up: 36.1 msilib Next: 36.1.2 View Objects 36.1.1 Database Objects OpenView ( sql ) Return a view object, by calling MSIDatabaseOpenView . sql is the SQL...

  • 5. Data Types
    Python Library Reference Previous: 4.11 fpformat Up: Python Library Reference Next: 5.1 datetime 5. Data Types The modules described in this chapter provide a variety of specialized data types such...

  • 5.1.3 date Objects
    Python Library Reference Previous: 5.1.2 timedelta Objects Up: 5.1 datetime Next: 5.1.4 datetime Objects 5.1.3 date Objects A date object represents a date (year, month and day) in an idealized...

  • 5.1.4 datetime Objects
    Python Library Reference Previous: 5.1.3 date Objects Up: 5.1 datetime Next: 5.1.5 time Objects 5.1.4 datetime Objects A datetime object is a single object containing all the information from a date...

  • 5.1.5 time Objects
    Python Library Reference Previous: 5.1.4 datetime Objects Up: 5.1 datetime Next: 5.1.6 tzinfo Objects 5.1.5 time Objects A time object represents a (local) time of day, independent of any particular...

  • 5.1.2 timedelta Objects
    Python Library Reference Previous: 5.1.1 Available Types Up: 5.1 datetime Next: 5.1.3 date Objects 5.1.2 timedelta Objects A timedelta object represents a duration, the difference between two dates...

  • 5.1.6 tzinfo Objects
    Python Library Reference Previous: 5.1.5 time Objects Up: 5.1 datetime Next: 5.1.7 strftime() Behavior 5.1.6 tzinfo Objects tzinfo is an abstract base clase, meaning that this class should not be...

  • 13.10.1 Database Objects
    Python Library Reference Previous: 13.10 dbhash Up: 13.10 dbhash Next: 13.11 bsddb 13.10.1 Database Objects The database objects returned by open() provide the methods common to all the DBM-style...

  • 24.1 Debugger Commands
    Python Library Reference Previous: 24. The Python Debugger Up: 24. The Python Debugger Next: 24.2 How It Works 24.1 Debugger Commands The debugger recognizes the following commands. Most commands can...

  • 24.2 How It Works
    Python Library Reference Previous: 24.1 Debugger Commands Up: 24. The Python Debugger Next: 25. The Python Profilers 24.2 How It Works Some changes were made to the interpreter: sys.settrace( func )...

  • 6.3.3 Context objects
    Python Library Reference Previous: 6.3.2 Decimal objects Up: 6.3 decimal Next: 6.3.4 Signals 6.3.3 Context objects Contexts are environments for arithmetic operations. They govern precision, set...

  • 6.3.8 Decimal FAQ
    Python Library Reference Previous: 6.3.7 Recipes Up: 6.3 decimal Next: 6.4 random 6.3.8 Decimal FAQ Q. It is cumbersome to type decimal.Decimal('1234.5') . Is there a way to minimize typing when...

  • 6.3.5 Floating Point Notes
    Python Library Reference Previous: 6.3.4 Signals Up: 6.3 decimal Next: 6.3.5.1 Mitigating round-off error 6.3.5 Floating Point Notes Subsections 6.3.5.1 Mitigating round-off error with increased...

  • 6.3.7 Recipes
    Python Library Reference Previous: 6.3.6 Working with threads Up: 6.3 decimal Next: 6.3.8 Decimal FAQ 6.3.7 Recipes Here are a few recipes that serve as utility functions and that demonstrate ways to...

  • 6.3.4 Signals
    Python Library Reference Previous: 6.3.3 Context objects Up: 6.3 decimal Next: 6.3.5 Floating Point Notes 6.3.4 Signals Signals represent conditions that arise during computation. Each corresponds to...

  • 6.3.6 Working with threads
    Python Library Reference Previous: 6.3.5.2 Special values Up: 6.3 decimal Next: 6.3.7 Recipes 6.3.6 Working with threads The getcontext() function accesses a different Context object for each thread....

  • 6.3.1 Quick-start Tutorial
    Python Library Reference Previous: 6.3 decimal Up: 6.3 decimal Next: 6.3.2 Decimal objects 6.3.1 Quick-start Tutorial The usual start to using decimals is importing the module, viewing the current...

  • 18.22.4 DefaultCookiePolicy Objects
    Python Library Reference Previous: 18.22.3 CookiePolicy Objects Up: 18.22 cookielib Next: 18.22.5 Cookie Objects 18.22.4 DefaultCookiePolicy Objects Implements the standard rules for accepting and...

  • 5.3.2.1 defaultdict Examples
    Python Library Reference Previous: 5.3.2 defaultdict objects Up: 5.3.2 defaultdict objects Next: 5.4 heapq 5.3.2.1 defaultdict Examples Using list as the default_factory , it is easy to group a...

  • 5.3.2 defaultdict objects
    Python Library Reference Previous: 5.3.1.1 Recipes Up: 5.3 collections Next: 5.3.2.1 defaultdict Examples 5.3.2 defaultdict objects defaultdict ( [ default_factory [ , ... ] ] ) Returns a new...

  • 5.3.1 deque objects
    Python Library Reference Previous: 5.3 collections Up: 5.3 collections Next: 5.3.1.1 Recipes 5.3.1 deque objects deque ( [ iterable ] ) Returns a new deque objected initialized left-to-right (using...

  • 5.3.1.1 Recipes
    Python Library Reference Previous: 5.3.1 deque objects Up: 5.3.1 deque objects Next: 5.3.2 defaultdict objects 5.3.1.1 Recipes This section shows various approaches to working with deques. The...

  • 23. Development Tools
    Python Library Reference Previous: 22.2.2 Parsing Rules Up: Python Library Reference Next: 23.1 pydoc 23. Development Tools The modules described in this chapter help you write software. For example,...

  • 4.4.4 Differ Example
    Python Library Reference Previous: 4.4.3 Differ Objects Up: 4.4 difflib Next: 4.5 StringIO 4.4.4 Differ Example This example compares two texts. First we set up the texts, sequences of individual...

  • 4.4.3 Differ Objects
    Python Library Reference Previous: 4.4.2 SequenceMatcher Examples Up: 4.4 difflib Next: 4.4.4 Differ Example 4.4.3 Differ Objects Note that Differ -generated deltas make no claim to be minimal diffs....

  • 11.5.1 The dircmp class
    Python Library Reference Previous: 11.5 filecmp Up: 11.5 filecmp Next: 11.6 tempfile 11.5.1 The dircmp class dircmp instances are built using this constructor: class   dircmp ( a, b [ , ignore [...

  • 16.6.1 Dl Objects
    Python Library Reference Previous: 16.6 dl Up: 16.6 dl Next: 16.7 termios 16.6.1 Dl Objects Dl objects, as returned by open() above, have the following methods: close ( ) Free all resources, except...

  • 23.2.6 Advanced API
    Python Library Reference Previous: 23.2.5 Unittest API Up: 23.2 doctest Next: 23.2.6.1 DocTest Objects 23.2.6 Advanced API The basic API is a simple wrapper that's intended to make doctest easy to...

  • 23.2.4 Basic API
    Python Library Reference Previous: 23.2.3.6 Warnings Up: 23.2 doctest Next: 23.2.5 Unittest API 23.2.4 Basic API The functions testmod() and testfile() provide a simple interface to doctest that...

  • 23.2.7 Debugging
    Python Library Reference Previous: 23.2.6.6 OutputChecker objects Up: 23.2 doctest Next: 23.2.8 Soapbox 23.2.7 Debugging Doctest provides several mechanisms for debugging doctest examples: Several...

  • 23.2.6.1 DocTest Objects
    Python Library Reference Previous: 23.2.6 Advanced API Up: 23.2.6 Advanced API Next: 23.2.6.2 Example Objects 23.2.6.1 DocTest Objects class   DocTest ( examples, globs, name, filename, lineno,...

  • 23.2.6.3 DocTestFinder objects
    Python Library Reference Previous: 23.2.6.2 Example Objects Up: 23.2.6 Advanced API Next: 23.2.6.4 DocTestParser objects 23.2.6.3 DocTestFinder objects class   DocTestFinder ( [ verbose ] [ ,...

  • 23.2.6.4 DocTestParser objects
    Python Library Reference Previous: 23.2.6.3 DocTestFinder objects Up: 23.2.6 Advanced API Next: 23.2.6.5 DocTestRunner objects 23.2.6.4 DocTestParser objects class   DocTestParser ( ) A...

  • 23.2.6.5 DocTestRunner objects
    Python Library Reference Previous: 23.2.6.4 DocTestParser objects Up: 23.2.6 Advanced API Next: 23.2.6.6 OutputChecker objects 23.2.6.5 DocTestRunner objects class   DocTestRunner ( [ checker ]...

  • 23.2.6.2 Example Objects
    Python Library Reference Previous: 23.2.6.1 DocTest Objects Up: 23.2.6 Advanced API Next: 23.2.6.3 DocTestFinder objects 23.2.6.2 Example Objects class   Example ( source, want [ , exc_msg ] [ ,...

  • 23.2.3.4 What About Exceptions?
    Python Library Reference Previous: 23.2.3.3 What's the Execution Up: 23.2.3 How It Works Next: 23.2.3.5 Option Flags and 23.2.3.4 What About Exceptions? No problem, provided that the traceback is the...

  • 23.2.3.3 What's the Execution Context?
    Python Library Reference Previous: 23.2.3.2 How are Docstring Up: 23.2.3 How It Works Next: 23.2.3.4 What About Exceptions? 23.2.3.3 What's the Execution Context? By default, each time doctest finds...

  • 23.2.3.2 How are Docstring Examples Recognized?
    Python Library Reference Previous: 23.2.3.1 Which Docstrings Are Up: 23.2.3 How It Works Next: 23.2.3.3 What's the Execution 23.2.3.2 How are Docstring Examples Recognized? In most cases a...

  • 23.2.3 How It Works
    Python Library Reference Previous: 23.2.2 Simple Usage: Checking Up: 23.2 doctest Next: 23.2.3.1 Which Docstrings Are 23.2.3 How It Works This section examines in detail how doctest works: which...

  • 23.2.3.5 Option Flags and Directives
    Python Library Reference Previous: 23.2.3.4 What About Exceptions? Up: 23.2.3 How It Works Next: 23.2.3.6 Warnings 23.2.3.5 Option Flags and Directives A number of option flags control various...

  • 23.2.6.6 OutputChecker objects
    Python Library Reference Previous: 23.2.6.5 DocTestRunner objects Up: 23.2.6 Advanced API Next: 23.2.7 Debugging 23.2.6.6 OutputChecker objects class   OutputChecker ( ) A class used to check...

  • 23.2.2 Simple Usage: Checking Examples in a Text File
    Python Library Reference Previous: 23.2.1 Simple Usage: Checking Up: 23.2 doctest Next: 23.2.3 How It Works 23.2.2 Simple Usage: Checking Examples in a Text File Another simple application of doctest...

  • 23.2.1 Simple Usage: Checking Examples in Docstrings
    Python Library Reference Previous: 23.2 doctest Up: 23.2 doctest Next: 23.2.2 Simple Usage: Checking 23.2.1 Simple Usage: Checking Examples in Docstrings The simplest way to start using doctest (but...

  • 23.2.8 Soapbox
    Python Library Reference Previous: 23.2.7 Debugging Up: 23.2 doctest Next: 23.3 unittest 23.2.8 Soapbox As mentioned in the introduction, doctest has grown to have three primary uses: Checking...

  • 23.2.5 Unittest API
    Python Library Reference Previous: 23.2.4 Basic API Up: 23.2 doctest Next: 23.2.6 Advanced API 23.2.5 Unittest API As your collection of doctest'ed modules grows, you'll want a way to run all their...

  • 23.2.3.6 Warnings
    Python Library Reference Previous: 23.2.3.5 Option Flags and Up: 23.2.3 How It Works Next: 23.2.4 Basic API 23.2.3.6 Warnings doctest is serious about requiring exact matches in expected output. If...

  • 23.2.3.1 Which Docstrings Are Examined?
    Python Library Reference Previous: 23.2.3 How It Works Up: 23.2.3 How It Works Next: 23.2.3.2 How are Docstring 23.2.3.1 Which Docstrings Are Examined? The module docstring, and all function, class...

  • 18.26.1 DocXMLRPCServer Objects
    Python Library Reference Previous: 18.26 DocXMLRPCServer Up: 18.26 DocXMLRPCServer Next: 18.26.2 DocCGIXMLRPCRequestHandler 18.26.1 DocXMLRPCServer Objects The DocXMLRPCServer class is derived from...

  • 8.6.3.2 Accessor Methods
    Python Library Reference Previous: 8.6.3.1 Type Mapping Up: 8.6.3 Conformance Next: 8.7 xml.dom.minidom 8.6.3.2 Accessor Methods The mapping from OMG IDL to Python defines accessor functions for IDL...

  • 8.6.2.8 NamedNodeMap Objects
    Python Library Reference Previous: 8.6.2.7 Attr Objects Up: 8.6.2 Objects in the Next: 8.6.2.9 Comment Objects 8.6.2.8 NamedNodeMap Objects NamedNodeMap does not inherit from Node . length The length...

  • 8.6.2.7 Attr Objects
    Python Library Reference Previous: 8.6.2.6 Element Objects Up: 8.6.2 Objects in the Next: 8.6.2.8 NamedNodeMap Objects 8.6.2.7 Attr Objects Attr inherits from Node , so inherits all its attributes....

  • 8.6.2.9 Comment Objects
    Python Library Reference Previous: 8.6.2.8 NamedNodeMap Objects Up: 8.6.2 Objects in the Next: 8.6.2.10 Text and CDATASection 8.6.2.9 Comment Objects Comment represents a comment in the XML document....

  • 8.6.3 Conformance
    Python Library Reference Previous: 8.6.2.12 Exceptions Up: 8.6 xml.dom Next: 8.6.3.1 Type Mapping 8.6.3 Conformance This section describes the conformance requirements and relationships between the...

  • 8.6.2.5 Document Objects
    Python Library Reference Previous: 8.6.2.4 DocumentType Objects Up: 8.6.2 Objects in the Next: 8.6.2.6 Element Objects 8.6.2.5 Document Objects A Document represents an entire XML document, including...

  • 8.6.2.4 DocumentType Objects
    Python Library Reference Previous: 8.6.2.3 NodeList Objects Up: 8.6.2 Objects in the Next: 8.6.2.5 Document Objects 8.6.2.4 DocumentType Objects Information about the notations and entities declared...

  • 8.6.2.6 Element Objects
    Python Library Reference Previous: 8.6.2.5 Document Objects Up: 8.6.2 Objects in the Next: 8.6.2.7 Attr Objects 8.6.2.6 Element Objects Element is a subclass of Node , so inherits all the attributes...

  • 8.8.1 DOMEventStream Objects
    Python Library Reference Previous: 8.8 xml.dom.pulldom Up: 8.8 xml.dom.pulldom Next: 8.9 xml.sax 8.8.1 DOMEventStream Objects getEvent ( ) ... expandNode ( node ) ... reset ( ) ... Python Library...

  • 8.7.2 DOM Example
    Python Library Reference Previous: 8.7.1 DOM Objects Up: 8.7 xml.dom.minidom Next: 8.7.3 minidom and the 8.7.2 DOM Example This example program is a fairly realistic example of a simple program. In...

  • 8.6.2.12 Exceptions
    Python Library Reference Previous: 8.6.2.11 ProcessingInstruction Objects Up: 8.6.2 Objects in the Next: 8.6.3 Conformance 8.6.2.12 Exceptions New in version 2.1. The DOM Level 2 recommendation...

  • 8.6.2.1 DOMImplementation Objects
    Python Library Reference Previous: 8.6.2 Objects in the Up: 8.6.2 Objects in the Next: 8.6.2.2 Node Objects 8.6.2.1 DOMImplementation Objects The DOMImplementation interface provides a way for...

  • 8.6.2.3 NodeList Objects
    Python Library Reference Previous: 8.6.2.2 Node Objects Up: 8.6.2 Objects in the Next: 8.6.2.4 DocumentType Objects 8.6.2.3 NodeList Objects A NodeList represents a sequence of nodes. These objects...

  • 8.6.2.2 Node Objects
    Python Library Reference Previous: 8.6.2.1 DOMImplementation Objects Up: 8.6.2 Objects in the Next: 8.6.2.3 NodeList Objects 8.6.2.2 Node Objects All of the components of an XML document are...

  • 8.7.1 DOM Objects
    Python Library Reference Previous: 8.7 xml.dom.minidom Up: 8.7 xml.dom.minido