How This Book Is Organized

This book has five parts, as follows.

Part I, Getting Started with Python

Chapter 1

Covers the general characteristics of the Python language and its implementations, and discusses where to get help and information.

Chapter 2

Explains how to obtain and install Python on your computer(s).

Chapter 3

Covers the Python interpreter program, its command-line options, and how it is used to run Python programs and in interactive sessions. The chapter also mentions text editors that are particularly suitable for editing Python programs and auxiliary programs for thoroughly checking your Python sources, and examines some full-fledged integrated development environments, including IDLE, which comes free with standard Python.

Part II, Core Python Language and Built-ins

Chapter 4

Covers Python syntax, built-in data types, expressions, statements, and how to write and call functions.

Chapter 5

Explains object-oriented programming in Python.

Chapter 6

Covers how to deal with errors and abnormal conditions in Python programs.

Chapter 7

Covers how Python lets you group code into modules and packages, how to define and import modules, and how to install third-party Python extensions that are packaged in standard Python ways.

Chapter 8

Refers to built-in data types and functions, and some of the most fundamental modules in the standard Python library (roughly, modules supplying functionality that, in some other languages, is built into the language itself).

Chapter 9

Covers Python’s powerful string-processing facilities, including Unicode strings and regular expressions.

Part III, Python Library and Extension Modules

Chapter 10

Explains how to deal with files and text processing using built-in Python file objects, many modules from Python’s standard library, and platform-specific extensions for rich text I/O. The chapter also covers issues of internationalization and localization, and the specific task of defining interactive text-mode command sessions with Python.

Chapter 11

Introduces Python’s serialization and persistence mechanisms, as well as Python’s interfaces to DBM databases, the Berkeley Database, and relational (SQL-based) databases.

Chapter 12

Covers how to deal with times and dates in Python, using the standard library and popular extensions.

Chapter 13

Explains how to achieve advanced execution control in Python, including execution of dynamically generated code and control of garbage-collection operations. The chapter also covers some Python internal types, and the specific issue of registering “clean-up” functions to be executed at program-termination time.

Chapter 14

Covers Python’s functionality for concurrent execution, both via multiple threads running within one process and via multiple processes running on a single machine. The chapter also covers how to access the process’s environment, and how to access files via memory-mapping mechanisms.

Chapter 15

Shows Python’s features for numeric computations, both in standard library modules and in third-party extension packages; in particular, the chapter covers how to use decimal floating-point numbers instead of the default binary floating-point numbers. The chapter also covers how to get and use pseudorandom and truly random numbers.

Chapter 16

Covers built-in and extension packages for array handling, focusing on the traditional Numeric third-party extension, and mentions other, more recently developed alternatives.

Chapter 17

Explains how to develop graphical user interfaces in Python with the Tkinter package included with the standard Python distribution, and briefly mentions other alternative Python GUI frameworks.

Chapter 18

Deals with Python tools and approaches that help ensure your programs are correct (i.e., that your programs do what they’re meant to do), find and correct errors in your programs, and check and enhance your programs’ performance. The chapter also covers the concept of “warning” and the Python library module that deals with it.

Part IV, Network and Web Programming

Chapter 19

Covers many modules in Python’s standard library that help you write network client programs, particularly by dealing with various network protocols from the client side and handling URLs.

Chapter 20

Explains Python’s interfaces to low-level network mechanisms (sockets), standard Python library modules that help you write network server programs, and asynchronous (event-driven) network programming with standard modules and the powerful Twisted extension.

Chapter 21

Covers the basics of CGI programming, how to perform CGI programming in Python with standard Python library modules, and how use “cookies” to deal with session-state in HTTP server-side programming. The chapter also mentions many alternatives to CGI programming for server-side web programming through popular Python extensions.

Chapter 22

Shows how to process email and other network-structured and encoded documents in Python.

Chapter 23

Covers Python library modules that let you process and generate HTML documents.

Chapter 24

Covers Python library modules and popular extensions that let you process, modify, and generate XML documents.

Part V, Extending and Embedding

Chapter 25

Shows how to code Python extension modules using C and other classic compiled languages, how to embed Python in applications coded in such languages, and alternative ways to extend Python and access existing C, C++, and Fortran libraries.

Chapter 26

Shows how to use Java classes from the Jython implementation of Python, and how to embed Jython in applications coded in Java.

Chapter 27

Covers the tools that let you package Python extensions, modules, and applications for distribution.

Get Python in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.