- Front Matter
- Contents
- 1. Whetting Your Appetite
- 2. Using the Python Interpreter
- 3. An Informal Introduction to Python
- 4. More Control Flow Tools
- 5. Data Structures
- 6. Modules
- 7. Input and Output
- 8. Errors and Exceptions
- 9. Classes
- 10. What Now?
- A. Interactive Input Editing and History Substitution
- About this document ...
- Front Matter
- Contents
- 1. Introduction
- 2. Lexical analysis
- 3. Data model
- 4. Execution model
- 5. Expressions
- 6. Simple statements
- 6.1 Expression statements
- 6.2 Assert statements
- 6.3 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 raise statement
- 6.9 The break statement
- 6.10 The continue statement
- 6.11 The import statement
- 6.12 The global statement
- 6.13 The exec statement
- 7. Compound statements
- 8. Top-level components
- Index
- About this document ...
- Front Matter
- Contents
- 1. Introduction
- 2. Built-in Types, Exceptions and Functions
- 3. Python Services
- 3.1 sys -- System-specific parameters and functions
- 3.2 types -- Names for all built-in types.
- 3.3 UserDict -- Class wrapper for dictionary objects.
- 3.4 UserList -- Class wrapper for list objects.
- 3.5 operator -- Standard operators as functions.
- 3.6 traceback -- Print or retrieve a stack traceback.
- 3.7 pickle -- Python object serialization
- 3.8 cPickle -- Alternate implementation of pickle
- 3.9 copy_reg -- Register pickle support functions
- 3.10 shelve -- Python object persistency
- 3.11 copy -- Shallow and deep copy operations
- 3.12 marshal -- Alternate Python object serialization
- 3.13 imp -- Access the import internals
- 3.14 parser -- Access parse trees for Python code
- 3.15 symbol -- Constants used with Python parse trees
- 3.16 token -- Constants used with Python parse trees
- 3.17 keyword -- Testing for Python keywords
- 3.18 tokenize -- Tokenizer for Python source
- 3.19 pyclbr -- Python class browser support
- 3.20 code -- Code object services.
- 3.21 pprint -- Data pretty printer.
- 3.22 repr -- Alternate repr() implementation.
- 3.23 py_compile -- Compile Python source files.
- 3.24 compileall -- Byte-compile Python libraries.
- 3.25 dis -- Disassembler.
- 3.26 site -- Site-specific configuration hook
- 3.27 user -- User-specific configuration hook
- 3.28 __builtin__ -- Built-in functions
- 3.29 __main__ -- Top-level script environment.
- 4. String Services
- 4.1 string -- Common string operations
- 4.2 re -- Perl-style regular expression operations.
- 4.3 regex -- Regular expression search and match operations.
- 4.4 regsub -- String operations using regular expressions
- 4.5 struct -- Interpret strings as packed binary data.
- 4.6 StringIO -- Read and write strings as files
- 4.7 cStringIO -- Faster version of StringIO
- 5. Miscellaneous Services
- 5.1 math -- Mathematical functions
- 5.2 cmath -- Mathematical functions for complex numbers
- 5.3 whrandom -- Floating point pseudo-random number generator.
- 5.4 random -- Generate pseudo-random numbers
- 5.5 bisect -- Array bisection algorithm
- 5.6 array -- Efficient arrays of numeric values
- 5.7 ConfigParser -- Configuration file parser
- 5.8 fileinput -- Iteration over lines from multiple input streams.
- 5.9 calendar -- Functions that emulate the Unix cal program.
- 5.10 cmd -- Build line-oriented command interpreters.
- 5.11 shlex -- Simple lexical analysis.
- 6. Generic Operating System Services
- 6.1 os -- Miscellaneous OS interfaces
- 6.2 os.path -- Common pathname manipulations
- 6.3 stat -- Interpreting stat() results
- 6.4 time -- Time access and conversions.
- 6.5 getpass -- Portable password input
- 6.6 getopt -- Parser for command line options.
- 6.7 tempfile -- Generate temporary file names
- 6.8 errno -- Standard errno system symbols.
- 6.9 glob -- Unix style pathname pattern expansion
- 6.10 fnmatch -- Unix style filename pattern matching
- 6.11 shutil -- High-level file operations
- 6.12 locale -- Internationalization services
- 7. Optional Operating System Services
- 7.1 signal -- Set handlers for asynchronous events.
- 7.2 socket -- Low-level networking interface
- 7.3 select -- Waiting for I/O completion
- 7.4 thread -- Multiple threads of control
- 7.5 threading -- Higher-level threading interface
- 7.6 Queue -- A synchronized queue class.
- 7.7 anydbm -- Generic access to DBM-style databases
- 7.8 dumbdbm -- Portable DBM implementation
- 7.9 dbhash -- DBM-style interface to the BSD database library
- 7.10 whichdb -- Guess which DBM module created a database
- 7.11 bsddb -- Interface to Berkeley DB library
- 7.12 zlib -- Compression compatible with gzip
- 7.13 gzip -- Support for gzip files
- 8. Unix Specific Services
- 8.1 posix -- The most common POSIX system calls
- 8.2 pwd -- The password database
- 8.3 grp -- The group database
- 8.4 crypt -- Function used to check Unix passwords
- 8.5 dbm -- Simple ``database'' interface
- 8.6 gdbm -- GNU's reinterpretation of dbm
- 8.7 termios -- POSIX style tty control
- 8.8 TERMIOS -- Constants used with the termios module
- 8.9 fcntl -- The fcntl() and ioctl() system calls
- 8.10 posixfile -- File-like objects with locking support
- 8.11 resource -- Resource usage information
- 8.12 syslog -- Unix syslog library routines
- 8.13 popen2 -- Subprocesses with accessible standard I/O streams
- 8.14 commands -- Utilities for running commands
- 9. The Python Debugger
- 10. The Python Profiler
- 11. Internet Protocols and Support
- 11.1 cgi -- Common Gateway Interface support.
- 11.2 urllib -- Open an arbitrary object given by URL.
- 11.3 httplib -- HTTP protocol client
- 11.4 ftplib -- FTP protocol client
- 11.5 gopherlib -- Gopher protocol client
- 11.6 poplib -- POP3 protocol client
- 11.7 imaplib -- IMAP4 protocol client
- 11.8 nntplib -- NNTP protocol client
- 11.9 smtplib -- SMTP protocol client
- 11.10 telnetlib -- Telnet client
- 11.11 urlparse -- Parse URLs into components.
- 11.12 SocketServer -- A framework for network servers.
- 11.13 BaseHTTPServer -- Basic HTTP server.
- 12. Internet Data Handling
- 12.1 sgmllib -- Simple SGML parser
- 12.2 htmllib -- A parser for HTML documents
- 12.3 xmllib -- A parser for XML documents
- 12.4 formatter -- Generic output formatting
- 12.5 rfc822 -- Parse RFC 822 mail headers
- 12.6 mimetools -- Tools for parsing MIME messages
- 12.7 MimeWriter -- Generic MIME file writer
- 12.8 multifile -- Support for files containing distinct parts
- 12.9 binhex -- Encode and decode binhex4 files
- 12.10 uu -- Encode and decode uuencode files
- 12.11 binascii -- Convert between binary and ASCII
- 12.12 xdrlib -- Encode and decode XDR data.
- 12.13 mailcap -- Mailcap file handling.
- 12.14 mimetypes -- Map filenames to MIME types
- 12.15 base64 -- Encode and decode MIME base64 data
- 12.16 quopri -- Encode and decode MIME quoted-printable data
- 12.17 mailbox -- Read various mailbox formats
- 12.18 mhlib -- Access to MH mailboxes
- 12.19 mimify -- MIME processing of mail messages
- 12.20 netrc -- netrc file processing
- 13. Restricted Execution
- 14. Multimedia Services
- 14.1 audioop -- Manipulate raw audio data
- 14.2 imageop -- Manipulate raw image data
- 14.3 aifc -- Read and write AIFF and AIFC files
- 14.4 colorsys -- Conversions between color systems
- 14.5 rgbimg -- Read and write ``SGI RGB'' files
- 14.6 imghdr -- Determine the type of an image.
- 14.7 sndhdr -- Determine type of sound file.
- 15. Cryptographic Services
- 16. SGI IRIX Specific Services
- 16.1 al -- Audio functions on the SGI
- 16.2 AL -- Constants used with the al module
- 16.3 cd -- CD-ROM access on SGI systems
- 16.4 fl -- FORMS library interface for GUI applications
- 16.5 FL -- Constants used with the fl module
- 16.6 flp -- Functions for loading stored FORMS designs
- 16.7 fm -- Font Manager interface
- 16.8 gl -- Graphics Library interface
- 16.9 DEVICE -- Constants used with the gl module
- 16.10 GL -- Constants used with the gl module
- 16.11 imgfile -- Support for SGI imglib files
- 16.12 jpeg -- Read and write JPEG files
- 17. SunOS Specific Services
- 18. MS Windows Specific Services
- 19. Undocumented Modules
- Module Index
- Index
- About this document ...
- Front Matter
- Contents
- 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 Format Strings for PyArg_ParseTuple()
- 1.8 Keyword Parsing with PyArg_ParseTupleAndKeywords()
- 1.9 The Py_BuildValue() Function
- 1.10 Reference Counts
- 1.11 Writing Extensions in C++
- 1.12 Providing a C API for an Extension Module
- 2. Building C and C++ Extensions on Unix
- 3. Building C and C++ Extensions on Windows
- 4. Embedding Python in Another Application
- About this document ...
- __builtin__
- __main__
- aifc
- AL (IRIX)
- al (IRIX)
- anydbm
- array
- audioop
- base64
- BaseHTTPServer
- Bastion
- binascii
- binhex
- bisect
- bsddb (Unix, Windows)
- calendar
- cd (IRIX)
- cgi
- cmath
- cmd
- code
- colorsys
- commands (Unix)
- compileall
- ConfigParser
- copy
- copy_reg
- cPickle
- crypt (Unix)
- cStringIO
- ctb (Mac)
- dbhash (Unix, Windows)
- dbm (Unix)
- DEVICE (IRIX)
- dis
- dumbdbm
- EasyDialogs (Mac)
- errno
- exceptions
- fcntl (Unix)
- fileinput
- findertools (Mac)
- FL (IRIX)
- fl (IRIX)
- flp (IRIX)
- fm (IRIX)
- fnmatch
- formatter
- FrameWork (Mac)
- ftplib
- gdbm (Unix)
- getopt
- getpass
- GL (IRIX)
- gl (IRIX)
- glob
- gopherlib
- grp (Unix)
- gzip
- htmllib
- httplib
- ic (Mac)
- imageop
- imaplib
- imgfile (IRIX)
- imghdr
- imp
- jpeg (IRIX)
- keyword
- locale
- mac (Mac)
- macconsole (Mac)
- macdnr (Mac)
- macfs (Mac)
- MacOS (Mac)
- macostools (Mac)
- macpath
- macspeech (Mac)
- mactcp (Mac)
- mailbox
- mailcap
- marshal
- math
- md5
- mhlib
- mimetools
- mimetypes
- MimeWriter
- mimify
- MiniAEFrame (Mac)
- mpz
- msvcrt (Windows)
- multifile
- netrc
- nntplib
- operator
- os
- os.path
- parser
- pdb
- pickle
- popen2 (Unix, Windows)
- poplib
- posix (Unix)
- posixfile (Unix)
- pprint
- profile
- pstats
- pwd (Unix)
- py_compile
- pyclbr
- Queue
- quopri
- random
- re
- regex
- regsub
- repr
- resource (Unix)
- rexec
- rfc822
- rgbimg
- rotor
- select
- sgmllib
- sha
- shelve
- shlex
- shutil
- signal
- site
- smtplib
- sndhdr
- socket
- SocketServer
- stat
- string
- StringIO
- struct
- sunaudiodev (SunOS)
- symbol
- sys
- syslog (Unix)
- telnetlib
- tempfile
- TERMIOS (Unix)
- termios (Unix)
- thread
- threading
- time
- token
- tokenize
- traceback
- types
- urllib
- urlparse
- user
- UserDict
- UserList
- uu
- whichdb
- whrandom
- winsound (Windows)
- xdrlib
- xmllib
- zlib