Buying Options
Learning Python, Second Edition
Ebook $27.99
Add to Cart
Safari Books Online
Add to Cart
What is this?

Product Editions

Please consider the latest edition.

  1. Learning Python, Fourth Edition - September 2009
  2. Learning Python, Third Edition - October 2007
  3. Learning Python, Second Edition - December 2003
  4. Learning Python - April 1999
Description
Learning Python, Second Edition, offers programmers a comprehensive learning tool for Python and object-oriented programming. Thoroughly updated, this guide introduces the basic elements of the latest release of Python 2.3 and covers new features, such as list comprehensions, nested scopes, and iterators/generators.
Full Description
Table of Contents
  1. Getting Started

    1. Chapter 1 A Python Q&A Session

      1. Why Do People Use Python?
      2. Is Python a Scripting Language?
      3. Okay, But What's the Downside?
      4. Who Uses Python Today?
      5. What Can I Do with Python?
      6. What Are Python's Technical Strengths?
      7. How Does Python Stack Up to Language X?
    2. Chapter 2 How Python Runs Programs

      1. Introducing the Python Interpreter
      2. Program Execution
      3. Execution Model Variations
    3. Chapter 3 How You Run Programs

      1. Interactive Coding
      2. System Command Lines and Files
      3. Clicking Windows File Icons
      4. Module Imports and Reloads
      5. The IDLE User Interface
      6. Other IDEs
      7. Embedding Calls
      8. Frozen Binary Executables
      9. Text Editor Launch Options
      10. Other Launch Options
      11. Future Possibilities?
      12. Which Option Should I Use?
      13. Part I Exercises
  2. Types and Operations

    1. Chapter 4 Numbers

      1. Python Program Structure
      2. Why Use Built-in Types?
      3. Numbers
      4. Python Expression Operators
      5. Numbers in Action
      6. The Dynamic Typing Interlude
    2. Chapter 5 Strings

      1. String Literals
      2. Strings in Action
      3. String Formatting
      4. String Methods
      5. General Type Categories
    3. Chapter 6 Lists and Dictionaries

      1. Lists
      2. Lists in Action
      3. Dictionaries
      4. Dictionaries in Action
    4. Chapter 7 Tuples, Files, and Everything Else

      1. Tuples
      2. Files
      3. Type Categories Revisited
      4. Object Generality
      5. References Versus Copies
      6. Comparisons, Equality, and Truth
      7. Python's Type Hierarchies
      8. Other Types in Python
      9. Built-in Type Gotchas
      10. Part II Exercises
  3. Statements and Syntax

    1. Chapter 8 Assignment, Expressions, and Print

      1. Assignment Statements
      2. Expression Statements
      3. Print Statements
    2. Chapter 9 if Tests

      1. if Statements
      2. Python Syntax Rules
      3. Truth Tests
    3. Chapter 10 while and for Loops

      1. while Loops
      2. break, continue, pass, and the Loop else
      3. for Loops
      4. Loop Variations
    4. Chapter 11 Documenting Python Code

      1. The Python Documentation Interlude
      2. Common Coding Gotchas
      3. Part III Exercises
  4. Functions

    1. Chapter 12 Function Basics

      1. Why Use Functions?
      2. Coding Functions
      3. A First Example: Definitions and Calls
      4. A Second Example: Intersecting Sequences
    2. Chapter 13 Scopes and Arguments

      1. Scope Rules
      2. The global Statement
      3. Scopes and Nested Functions
      4. Passing Arguments
      5. Special Argument Matching Modes
    3. Chapter 14 Advanced Function Topics

      1. Anonymous Functions: lambda
      2. Applying Functions to Arguments
      3. Mapping Functions Over Sequences
      4. Functional Programming Tools
      5. List Comprehensions
      6. Generators and Iterators
      7. Function Design Concepts
      8. Function Gotchas
      9. Part IV Exercises
  5. Modules

    1. Chapter 15 Modules: The Big Picture

      1. Why Use Modules?
      2. Python Program Architecture
      3. How Imports Work
    2. Chapter 16 Module Coding Basics

      1. Module Creation
      2. Module Usage
      3. Module Namespaces
      4. Reloading Modules
    3. Chapter 17 Module Packages

      1. Package Import Basics
      2. Package Import Example
      3. Why Use Package Imports?
      4. A Tale of Three Systems
    4. Chapter 18 Advanced Module Topics

      1. Data Hiding in Modules
      2. Enabling Future Language Features
      3. Mixed Usage Modes: __name__ and __main__
      4. Changing the Module Search Path
      5. The import as Extension
      6. Module Design Concepts
      7. Module Gotchas
      8. Part V Exercises
  6. Classes and OOP

    1. Chapter 19 OOP: The Big Picture

      1. Why Use Classes?
      2. OOP from 30,000 Feet
    2. Chapter 20 Class Coding Basics

      1. Classes Generate Multiple Instance Objects
      2. Classes Are Customized by Inheritance
      3. Classes Can Intercept Python Operators
    3. Chapter 21 Class Coding Details

      1. The Class Statement
      2. Methods
      3. Inheritance
      4. Operator Overloading
      5. Namespaces: The Whole Story
    4. Chapter 22 Designing with Classes

      1. Python and OOP
      2. Classes as Records
      3. OOP and Inheritance: "is-a" Relationships
      4. OOP and Composition: "has-a" Relationships
      5. OOP and Delegation
      6. Multiple Inheritance
      7. Classes Are Objects: Generic Object Factories
      8. Methods Are Objects: Bound or Unbound
      9. Documentation Strings Revisited
      10. Classes Versus Modules
    5. Chapter 23 Advanced Class Topics

      1. Extending Built-in Types
      2. Pseudo-Private Class Attributes
      3. "New Style" Classes in Python 2.2
      4. Class Gotchas
      5. Part VI Exercises
  7. Exceptions and Tools

    1. Chapter 24 Exception Basics

      1. Why Use Exceptions?
      2. Exception Handling: The Short Story
      3. The try/except/else Statement
      4. The try/finally Statement
      5. The raise Statement
      6. The assert Statement
    2. Chapter 25 Exception Objects

      1. String-Based Exceptions
      2. Class-Based Exceptions
      3. General raise Statement Forms
    3. Chapter 26 Designing with Exceptions

      1. Nesting Exception Handlers
      2. Exception Idioms
      3. Exception Design Tips
      4. Exception Gotchas
      5. Core Language Summary
      6. Part VII Exercises
  8. The Outer Layers

    1. Chapter 27 Common Tasks in Python

      1. Exploring on Your Own
      2. Conversions, Numbers, and Comparisons
      3. Manipulating Strings
      4. Data Structure Manipulations
      5. Manipulating Files and Directories
      6. Internet-Related Modules
      7. Executing Programs
      8. Debugging, Testing, Timing, Profiling
      9. Exercises
    2. Chapter 28 Frameworks

      1. An Automated Complaint System
      2. Interfacing with COM: Cheap Public Relations
      3. A Tkinter-Based GUI Editor for Managing Form Data
      4. Jython: The Felicitous Union of Python and Java
      5. Exercises
    3. Chapter 29 Python Resources

      1. Layers of Community
      2. The Process
      3. Services and Products
      4. The Legal Framework: The Python Software Foundation
      5. Software
      6. Popular Third-Party Software
      7. Web Application Frameworks
      8. Tools for Python Developers
  9. Appendixes

    1. Appendix A Installation and Configuration

      1. Installing the Python Interpreter
    2. Appendix B Solutions to Exercises

      1. Part I, Getting Started
      2. Part II, Types and Operations
      3. Part III, Statements and Syntax
      4. Part IV, Functions
      5. Part V, Modules
      6. Part VI, Classes and OOP
      7. Part VII, Exceptions and Tools
      8. Part VIII, The Outer Layers
  1. Colophon

View Full Table of Contents
Product Details
Title:
Learning Python, Second Edition
By:
Mark Lutz, David Ascher
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
December 2003
Ebook Release:
February 2009
Pages:
624
Print ISBN:
978-0-596-00281-7
| ISBN 10:
0-596-00281-5
Ebook ISBN:
978-0-596-10337-8
| ISBN 10:
0-596-10337-9
Customer Reviews
About the Authors
  1. Mark Lutz

    Mark Lutz is an independent Python trainer, writer, and software developer, and is one of the primary figures in the Python community. He is the author of the O'Reilly books Programming Python and Python Pocket Reference (both in 2nd Editions), and co-author of Learning Python (both in 2nd Editions). Mark has been involved with Python since 1992, began teaching Python classes in 1997, and has instructed over 90 Python training sessions as of early 2003. In addition, he holds BS and MS degrees in computer science from the University of Wisconsin, and over the last two decades has worked on compilers, programming tools, scripting applications, and assorted client/server systems. Whenever Mark gets a break from spreading the Python word, he leads an ordinary, average life with his kids in Colorado. Mark can be reached by email at , or on the web at http://www.rmi.net/~lutz.

    View Mark Lutz's full profile page.

  2. David Ascher

    David Ascher is the lead for Python projects at ActiveState, including Komodo, ActiveState's integrated development environment written mostly in Python. David has taught courses about Python to corporations, in universities, and at conferences. He also organized the Python track at the 1999 and 2000 O'Reilly Open Source Conventions, and was the program chair for the 10th International Python Conference. In addition, he co-wrote Learning Python (both editions) and serves as a director of the Python Software Foundation. David holds a B.S. in physics and a Ph.D. in cognitive science, both from Brown University.

    View David Ascher'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 Learning Python, Second Edition is a wood rat (Neotoma, family Muridae). The wood rat lives in a wide range of living conditions (mostly rocky, scrub, and desert areas) over much of North and Central America, generally at some distance from humans, though they occasionally damage some crops. They are good climbers, nesting in trees or bushes up to six meters off the ground; some species burrow underground or in rock crevices or inhabit other species' abandoned holes.

These grayish-beige, medium-sized rodents are the original pack rats: they carry anythingand everything into their homes, whether or not it's needed, and are especially attracted to shiny objects such as tin cans, glass, and silverware. Matt Hutchinson was the production editor for Learning Python, Second Edition. Argosy Publishing provided production services. Colleen Gorman, Emily Quill, and Mary Anne Mayo provided quality control.

Edie Freedman designed the cover of this book. The cover image is a 19th-century engraving from Cuvier's Animals. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.

David Futato designed the interior layout. This book was converted by Julie Hawks 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 headingfont 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 usingMacromedia FreeHand 9 and Adobe Photoshop 6. The tip and warningicons were drawn by Christopher Bing. This colophon was written by Nancy Kotary.

  • Book cover of Learning Python