- Whetting Your Appetite
Using the Python Interpreter
An Informal Introduction to Python
More Control Flow Tools
Data Structures
Modules
Input and Output
Errors and Exceptions
Classes
Brief Tour of the Standard Library
Brief Tour of the Standard Library – Part II
- What Now?
Interactive Input Editing and History Substitution
Floating Point Arithmetic: Issues and Limitations
- Introduction
- Built-in Functions
Built-in Constants
- Built-in Objects
Built-in Types
- Truth Value Testing
- Boolean Operations — and, or, not
- Comparisons
- Numeric Types — int, float, complex
- Iterator Types
- Sequence Types — str, bytes, bytearray, list, tuple, range
- Set Types — set, frozenset
- Mapping Types — dict
- File Objects
- memoryview Types
- Context Manager Types
- Other Built-in Types
- Special Attributes
- Built-in Exceptions
String Services
Data Types
- datetime — Basic date and time types
- calendar — General calendar-related functions
- collections — Container datatypes
- heapq — Heap queue algorithm
- bisect — Array bisection algorithm
- array — Efficient arrays of numeric values
- sched — Event scheduler
- queue — A synchronized queue class
- weakref — Weak references
- types — Names for built-in types
- copy — Shallow and deep copy operations
- pprint — Data pretty printer
- reprlib — Alternate repr implementation
Numeric and Mathematical Modules
- numbers — Numeric abstract base classes
- math — Mathematical functions
- cmath — Mathematical functions for complex numbers
- decimal — Decimal fixed point and floating point arithmetic
- fractions — Rational numbers
- random — Generate pseudo-random numbers
- itertools — Functions creating iterators for efficient looping
- functools — Higher order functions and operations on callable objects
- operator — Standard operators as functions
File and Directory Access
- os.path — Common pathname manipulations
- fileinput — Iterate over lines from multiple input streams
- stat — Interpreting stat results
- filecmp — File and Directory Comparisons
- tempfile — Generate temporary files and directories
- glob — Unix style pathname pattern expansion
- fnmatch — Unix filename pattern matching
- linecache — Random access to text lines
- shutil — High-level file operations
- macpath — Mac OS 9 path manipulation functions
Data Persistence
Data Compression and Archiving
File Formats
Cryptographic Services
Generic Operating System Services
- os — Miscellaneous operating system interfaces
- io — Core tools for working with streams
- time — Time access and conversions
- optparse — More powerful command line option parser
- getopt — Parser for command line options
- logging — Logging facility for Python
- getpass — Portable password input
- curses — Terminal handling for character-cell displays
- curses.textpad — Text input widget for curses programs
- curses.wrapper — Terminal handler for curses programs
- curses.ascii — Utilities for ASCII characters
- curses.panel — A panel stack extension for curses.
- platform — Access to underlying platform’s identifying data.
- errno — Standard errno system symbols
- ctypes — A foreign function library for Python.
Optional Operating System Services
- select — Waiting for I/O completion
- threading — Higher-level threading interface
- dummy_threading — Drop-in replacement for the threading module
- _thread — Low-level threading API
- _dummy_thread — Drop-in replacement for the _thread module
- multiprocessing — Process-based “threading” interface
- mmap — Memory-mapped file support
- readline — GNU readline interface
- rlcompleter — Completion function for GNU readline
Interprocess Communication and Networking
Internet Data Handling
- email — An email and MIME handling package
- json — JSON encoder and decoder
- mailcap — Mailcap file handling
- mailbox — Manipulate mailboxes in various formats
- mimetypes — Map filenames to MIME types
- base64 — RFC 3548: Base16, Base32, Base64 Data Encodings
- binhex — Encode and decode binhex4 files
- binascii — Convert between binary and ASCII
- quopri — Encode and decode MIME quoted-printable data
- uu — Encode and decode uuencode files
Structured Markup Processing Tools
- html.parser — Simple HTML and XHTML parser
- html.entities — Definitions of HTML general entities
- xml.parsers.expat — Fast XML parsing using Expat
- xml.dom — The Document Object Model API
- xml.dom.minidom — Lightweight DOM implementation
- xml.dom.pulldom — Support for building partial DOM trees
- xml.sax — Support for SAX2 parsers
- xml.sax.handler — Base classes for SAX handlers
- xml.sax.saxutils — SAX Utilities
- xml.sax.xmlreader — Interface for XML parsers
- xml.etree.ElementTree — The ElementTree XML API
Internet Protocols and Support
- webbrowser — Convenient Web-browser controller
- cgi — Common Gateway Interface support.
- cgitb — Traceback manager for CGI scripts
- wsgiref — WSGI Utilities and Reference Implementation
- urllib.request — extensible library for opening URLs
- urllib.response — Response classes used by urllib.
- urllib.parse — Parse URLs into components
- urllib.error — Exception classes raised by urllib.request
- urllib.robotparser — Parser for robots.txt
- http.client — HTTP protocol client
- ftplib — FTP protocol client
- poplib — POP3 protocol client
- imaplib — IMAP4 protocol client
- nntplib — NNTP protocol client
- smtplib — SMTP protocol client
- smtpd — SMTP Server
- telnetlib — Telnet client
- uuid — UUID objects according to RFC 4122
- socketserver — A framework for network servers
- http.server — HTTP servers
- http.cookies — HTTP state management
- http.cookiejar — Cookie handling for HTTP clients
- xmlrpc.client — XML-RPC client access
- xmlrpc.server — Basic XML-RPC servers
Multimedia Services
- audioop — Manipulate raw audio data
- aifc — Read and write AIFF and AIFC files
- sunau — Read and write Sun AU files
- wave — Read and write WAV files
- chunk — Read IFF chunked data
- colorsys — Conversions between color systems
- imghdr — Determine the type of an image
- sndhdr — Determine type of sound file
- ossaudiodev — Access to OSS-compatible audio devices
Internationalization
Program Frameworks
Graphical User Interfaces with Tk
Development Tools
Debugging and Profiling
Python Runtime Services
- sys — System-specific parameters and functions
- builtins — Built-in objects
- __main__ — Top-level script environment
- warnings — Warning control
- contextlib — Utilities for with-statement contexts.
- abc — Abstract Base Classes
- atexit — Exit handlers
- traceback — Print or retrieve a stack traceback
- __future__ — Future statement definitions
- gc — Garbage Collector interface
- inspect — Inspect live objects
- site — Site-specific configuration hook
- fpectl — Floating point exception control
Custom Python Interpreters
Importing Modules
Python Language Services
- parser — Access Python parse trees
- Abstract Syntax Trees
- symtable — Access to the compiler’s symbol tables
- symbol — Constants used with Python parse trees
- token — Constants used with Python parse trees
- keyword — Testing for Python keywords
- tokenize — Tokenizer for Python source
- tabnanny — Detection of ambiguous indentation
- pyclbr — Python class browser support
- py_compile — Compile Python source files
- compileall — Byte-compile Python libraries
- dis — Disassembler for Python bytecode
- pickletools — Tools for pickle developers.
- distutils — Building and installing Python modules
Miscellaneous Services
MS Windows Specific Services
Unix Specific Services
- posix — The most common POSIX system calls
- pwd — The password database
- spwd — The shadow password database
- grp — The group database
- crypt — Function to check Unix passwords
- termios — POSIX style tty control
- tty — Terminal control functions
- pty — Pseudo-terminal utilities
- fcntl — The fcntl and ioctl system calls
- pipes — Interface to shell pipelines
- resource — Resource usage information
- nis — Interface to Sun’s NIS (Yellow Pages)
- syslog — Unix syslog library routines
Undocumented Modules
Extending Python with C or C++
- A Simple Example
- Intermezzo: Errors and Exceptions
- Back to the Example
- The Module’s Method Table and Initialization Function
- Compilation and Linkage
- Calling Python Functions from C
- Extracting Parameters in Extension Functions
- Keyword Parameters for Extension Functions
- Building Arbitrary Values
- Reference Counts
- Writing Extensions in C++
- Providing a C API for an Extension Module
Defining New Types
Building C and C++ Extensions with distutils
Building C and C++ Extensions on Windows
Embedding Python in Another Application
- __future__
- __main__
- _dummy_thread
- _thread
- abc
- aifc
- array
- ast
- asynchat
- asyncore
- atexit
- audioop
- base64
- bdb
- binascii
- binhex
- bisect
- builtins
- bz2
- calendar
- cgi
- cgitb
- chunk
- cmath
- cmd
- code
- codecs
- codeop
- collections
- colorsys
- compileall
- configparser
- contextlib
- copy
- copyreg
- cProfile
- crypt (Unix)
- csv
- ctypes
- curses
- curses.ascii
- curses.panel
- curses.textpad
- curses.wrapper
- datetime
- dbm
- dbm.dumb
- dbm.gnu (Unix)
- dbm.ndbm (Unix)
- decimal
- difflib
- dis
- distutils
- distutils.archive_util
- distutils.bcppcompiler
- distutils.ccompiler
- distutils.cmd
- distutils.command
- distutils.command.bdist
- distutils.command.bdist_dumb
- distutils.command.bdist_msi
- distutils.command.bdist_packager
- distutils.command.bdist_rpm
- distutils.command.bdist_wininst
- distutils.command.build
- distutils.command.build_clib
- distutils.command.build_ext
- distutils.command.build_py
- distutils.command.build_scripts
- distutils.command.clean
- distutils.command.config
- distutils.command.install
- distutils.command.install_data
- distutils.command.install_headers
- distutils.command.install_lib
- distutils.command.install_scripts
- distutils.command.register
- distutils.command.sdist
- distutils.core
- distutils.cygwinccompiler
- distutils.debug
- distutils.dep_util
- distutils.dir_util
- distutils.dist
- distutils.emxccompiler
- distutils.errors
- distutils.extension
- distutils.fancy_getopt
- distutils.file_util
- distutils.filelist
- distutils.log
- distutils.msvccompiler
- distutils.mwerkscompiler
- distutils.spawn
- distutils.sysconfig
- distutils.text_file
- distutils.unixccompiler
- distutils.util
- distutils.version
- doctest
- dummy_threading
- email.charset
- email.encoders
- email.errors
- email.generator
- email.header
- email.iterators
- email.message
- email.mime
- email.parser
- email.utils
- encodings.idna
- encodings.utf_8_sig
- errno
- exceptions
- fcntl (Unix)
- filecmp
- fileinput
- fnmatch
- formatter
- fpectl (Unix)
- fractions
- ftplib
- functools
- gc
- getopt
- getpass
- gettext
- glob
- grp (Unix)
- gzip
- hashlib
- heapq
- hmac
- html.entities
- html.parser
- http.client
- http.cookiejar
- http.cookies
- http.server
- imaplib
- imghdr
- imp
- inspect
- io
- itertools
- json
- keyword
- lib2to3
- linecache
- locale
- logging
- macpath
- mailbox
- mailcap
- marshal
- math
- mimetypes
- mmap
- modulefinder
- msilib (Windows)
- msvcrt (Windows)
- multiprocessing
- multiprocessing.connection
- multiprocessing.dummy
- multiprocessing.managers
- multiprocessing.pool
- multiprocessing.sharedctypes
- netrc
- nis (Unix)
- nntplib
- numbers
- operator
- optparse
- os
- os.path
- ossaudiodev (Linux, FreeBSD)
- parser
- pdb
- pickle
- pickletools
- pipes (Unix)
- pkgutil
- platform
- plistlib
- poplib
- posix (Unix)
- pprint
- pstats
- pty (IRIX, Linux)
- pwd (Unix)
- py_compile
- pyclbr
- pydoc
- queue
- quopri
- random
- re
- readline (Unix)
- reprlib
- resource (Unix)
- rlcompleter
- runpy
- sched
- select
- shelve
- shlex
- shutil
- signal
- site
- smtpd
- smtplib
- sndhdr
- socket
- socketserver
- spwd (Unix)
- sqlite3
- ssl
- stat
- string
- stringprep
- struct
- subprocess
- sunau
- symbol
- symtable
- sys
- syslog (Unix)
- tabnanny
- tarfile
- telnetlib
- tempfile
- termios (Unix)
- test
- test.support
- textwrap
- threading
- time
- timeit
- tkinter
- tkinter.scrolledtext (Tk)
- tkinter.tix
- token
- tokenize
- trace
- traceback
- tty (Unix)
- turtle
- types
- unicodedata
- unittest
- urllib.error
- urllib.parse
- urllib.request
- urllib.response
- urllib.robotparser
- uu
- uuid
- warnings
- wave
- weakref
- webbrowser
- winreg (Windows)
- winsound (Windows)
- wsgiref
- wsgiref.handlers
- wsgiref.headers
- wsgiref.simple_server
- wsgiref.util
- wsgiref.validate
- xdrlib
- xml.dom
- xml.dom.minidom
- xml.dom.pulldom
- xml.etree.ElementTree
- xml.parsers.expat
- xml.sax
- xml.sax.handler
- xml.sax.saxutils
- xml.sax.xmlreader
- xmlrpc.client
- xmlrpc.server
- zipfile
- zipimport
- zlib