Buying Options
Python in a Nutshell
Safari Books Online
Add to Cart
What is this?

Product Editions

Please consider the latest edition.

  1. Python in a Nutshell, Second Edition - July 2006
  2. Python in a Nutshell - March 2003
Description
In the tradition of O'Reilly's "In a Nutshell" series, Python in a Nutshell offers Python programmers one place to look when they need help remembering or deciphering the syntax of this open source language and its many modules. This comprehensive reference guide makes it easy to look up all the most frequently needed information--not just about the Python language itself, but also the most frequently used parts of the standard library and the most important third-party extensions.
Full Description
Table of Contents
  1. Getting Started with Python

    1. Chapter 1 Introduction to Python

      1. The Python Language
      2. The Python Standard Library and Extension Modules
      3. Python Implementations
      4. Python Development and Versions
      5. Python Resources
    2. Chapter 2 Installation

      1. Installing Python from Source Code
      2. Installing Python from Binaries
      3. Installing Jython
    3. Chapter 3 The Python Interpreter

      1. The python Program
      2. Python Development Environments
      3. Running Python Programs
      4. The Jython Interpreter
  2. Core Python Language and Built-ins

    1. Chapter 4 The Python Language

      1. Lexical Structure
      2. Data Types
      3. Variables and Other References
      4. Expressions and Operators
      5. Numeric Operations
      6. Sequence Operations
      7. Dictionary Operations
      8. The print Statement
      9. Control Flow Statements
      10. Functions
    2. Chapter 5 Object-Oriented Python

      1. Classic Classes and Instances
      2. New-Style Classes and Instances
      3. Special Methods
      4. Metaclasses
    3. Chapter 6 Exceptions

      1. The try Statement
      2. Exception Propagation
      3. The raise Statement
      4. Exception Objects
      5. Custom Exception Classes
      6. Error-Checking Strategies
    4. Chapter 7 Modules

      1. Module Objects
      2. Module Loading
      3. Packages
      4. The Distribution Utilities (distutils)
    5. Chapter 8 Core Built-ins

      1. Built-in Types
      2. Built-in Functions
      3. The sys Module
      4. The getopt Module
      5. The copy Module
      6. The bisect Module
      7. The UserList, UserDict, and UserString Modules
    6. Chapter 9 Strings and Regular Expressions

      1. Methods of String Objects
      2. The string Module
      3. String Formatting
      4. The pprint Module
      5. The repr Module
      6. Unicode
      7. Regular Expressions and the re Module
  3. Python Library and Extension Modules

    1. Chapter 10 File and Text Operations

      1. The os Module
      2. Filesystem Operations
      3. File Objects
      4. Auxiliary Modules for File I/O
      5. The StringIO and cStringIO Modules
      6. Compressed Files
      7. Text Input and Output
      8. Richer-Text I/O
      9. Interactive Command Sessions
      10. Internationalization
    2. Chapter 11 Persistence and Databases

      1. Serialization
      2. DBM Modules
      3. The Berkeley DB Module
      4. The Python Database API (DBAPI) 2.0
    3. Chapter 12 Time Operations

      1. The time Module
      2. The sched Module
      3. The calendar Module
      4. The mx.DateTime Module
    4. Chapter 13 Controlling Execution

      1. Dynamic Execution and the exec Statement
      2. Restricted Execution
      3. Internal Types
      4. Garbage Collection
      5. Termination Functions
      6. Site and User Customization
    5. Chapter 14 Threads and Processes

      1. Threads in Python
      2. The thread Module
      3. The Queue Module
      4. The threading Module
      5. Threaded Program Architecture
      6. Process Environment
      7. Running Other Programs
      8. The mmap Module
    6. Chapter 15 Numeric Processing

      1. The math and cmath Modules
      2. The operator Module
      3. The random Module
      4. The array Module
      5. The Numeric Package
      6. Array Objects
      7. Universal Functions (ufuncs)
      8. Optional Numeric Modules
    7. Chapter 16 Tkinter GUIs

      1. Tkinter Fundamentals
      2. Widget Fundamentals
      3. Commonly Used Simple Widgets
      4. Container Widgets
      5. Menus
      6. The Text Widget
      7. The Canvas Widget
      8. Geometry Management
      9. Tkinter Events
    8. Chapter 17 Testing, Debugging, and Optimizing

      1. Testing
      2. Debugging
      3. The warnings Module
      4. Optimization
  4. Network and Web Programming

    1. Chapter 18 Client-Side Network Protocol Modules

      1. URL Access
      2. Email Protocols
      3. The HTTP and FTP Protocols
      4. Network News
      5. Telnet
      6. Distributed Computing
    2. Chapter 19 Sockets and Server-Side Network Protocol Modules

      1. The socket Module
      2. The SocketServer Module
      3. Event-Driven Socket Programs
    3. Chapter 20 CGI Scripting and Alternatives

      1. CGI in Python
      2. Cookies
      3. Other Server-Side Approaches
    4. Chapter 21 MIME and Network Encodings

      1. Encoding Binary Data as Text
      2. MIME and Email Format Handling
    5. Chapter 22 Structured Text: HTML

      1. The sgmllib Module
      2. The htmllib Module
      3. The HTMLParser Module
      4. Generating HTML
    6. Chapter 23 Structured Text: XML

      1. An Overview of XML Parsing
      2. Parsing XML with SAX
      3. Parsing XML with DOM
      4. Changing and Generating XML
  5. Extending and Embedding

    1. Chapter 24 Extending and Embedding Classic Python

      1. Extending Python with Python's C API
      2. Extending Python Without Python's C API
      3. Embedding Python
    2. Chapter 25 Extending and Embedding Jython

      1. Importing Java Packages in Jython
      2. Embedding Jython in Java
      3. Compiling Python into Java
    3. Chapter 26 Distributing Extensions and Programs

      1. Python's distutils
      2. The py2exe Tool
      3. The Installer Tool
  1. Colophon

View Full Table of Contents
Product Details
Title:
Python in a Nutshell
By:
Alex Martelli
Publisher:
O'Reilly Media
Formats:
  • Print
  • Safari Books Online
Print Release:
March 2003
Pages:
656
Print ISBN:
978-0-596-00188-9
| ISBN 10:
0-596-00188-6
Customer Reviews
About the Author
  1. Alex Martelli

    Alex Martelli spent 8 years with IBM Research, winning three Outstanding Technical Achievement Awards. He then spent 13 as a Senior Software Consultant at think3 inc, developing libraries, network protocols, GUI engines, event frameworks, and web access frontends. He has also taught programming languages, development methods, and numerical computing at Ferrara University and other venues. He's a C++ MVP for Brainbench, and a member of the Python Software Foundation. He currently works for AB Strakt, a Python-centered software house in Gteborg, Sweden, mostly by telecommuting from his home in Bologna, Italy. Alex's proudest achievement is the articles that appeared in Bridge World (January/February 2000), which were hailed as giant steps towards solving issues that had haunted contract bridge theoreticians for decades.

    View Alex Martelli's full profile page.

Colophon

Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Python in a Nutshell is an African rock python, one of approximately 18 species of python. Pythons are nonvenomous constrictor snakes that live in tropical regions of Africa, Asia, Australia, and some Pacific Islands. Pythons live mainly on the ground, but they are also excellent swimmers and climbers. Both male and female pythons retain vestiges of their ancestral hind legs. The male python uses these vestiges, or spurs, when courting a female.

The python kills its prey by suffocation. While the snake's sharp teeth grip and hold the prey in place, the python's long body coils around its victim's chest, constricting tighter each time it breathes out. They feed primarily on mammals and birds. Python attacks on humans are extremely rare. Emily Quill was the production editor and copyeditor for Python in a Nutshell. Linley Dolby and Tatiana Apandi Diaz provided quality control. Philip Dangler, Judy Hoer, and Genevieve d'Entremont provided production assistance. Nancy Crumpton wrote the index.

Emma Colby designed the cover ofthis book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.

Bret Kerr designed the interior layout, based on a series design by David Futato. This book was converted by Mike Sierra to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. This colophon was written by Nicole Arigo.

  • Book cover of Python in a Nutshell