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