Python Pocket Reference, Third Edition

Book description

Python is optimized for quality, productivity, portability, and integration. Hundreds of thousands of Python developers around the world rely on Python for general-purpose tasks, Internet scripting, systems programming, user interfaces, and product customization. Available on all major computing platforms, including commercial versions of Unix, Linux, Windows, and Mac OS X, Python is portable, powerful and remarkable easy to use. With its convenient, quick-reference format, Python Pocket Reference, 3rd Edition is the perfect on-the-job reference. More importantly, it's now been refreshed to cover the language's latest release, Python 2.4. For experienced Python developers, this book is a compact toolbox that delivers need-to-know information at the flip of a page. This third edition also includes an easy-lookup index to help developers find answers fast! Python 2.4 is more than just optimization and library enhancements; it's also chock full of bug fixes and upgrades. And these changes are addressed in the Python Pocket Reference, 3rd Edition. New language features, new and upgraded built-ins, and new and upgraded modules and packages--they're all clarified in detail. The Python Pocket Reference, 3rd Edition serves as the perfect companion to Learning Python and Programming Python.

Table of contents

  1. Contents (1/2)
  2. Contents (2/2)
  3. Python Pocket Reference
    1. Introduction
    2. Conventions
    3. Command-Line Options
      1. Python Options
      2. Program Specification
    4. Environment Variables
    5. Built-in Types and Operators
      1. Operators and Precedence
      2. Operations by Category
      3. Sequence Operation Notes
        1. Indexing: S[i]
        2. Slicing: S[i:j]
        3. Slicing: S[i:j:k]
        4. Other
    6. Specific Built-in Types
      1. Numbers
        1. Literals
        2. Operations
      2. Strings (1/2)
      3. Strings (2/2)
        1. Literals
        2. Operations
        3. String formatting
        4. Template string substitution
        5. String methods
        6. Searching
        7. Splitting and joining
        8. Formatting
        9. Content tests
        10. The original string module
      4. Unicode Strings
        1. Literals
        2. Operations
      5. Lists
        1. Literals and creation
        2. Operations
        3. List comprehension expressions
        4. Generator expressions
      6. Dictionaries
        1. Literals and creation
        2. Operations
      7. Tuples
        1. Literals
        2. Operations
      8. Files
        1. Input files
        2. Output files
        3. Any files
        4. Attributes (all read-only)
        5. Notes
      9. Other Common Types
        1. Boolean
        2. Sets
        3. Decimal
      10. Type Conversions
    7. Statements and Syntax
      1. Syntax Rules
      2. Name Rules
        1. Name format
        2. Name conventions
    8. Specific Statements
      1. Assignment
        1. Augmented assignment
      2. Expressions
        1. apply( )-like call syntax
      3. The print Statement
        1. Extended print form
      4. The if Statement
      5. The while Statement
      6. The for Statement
      7. The pass Statement
      8. The break Statement
      9. The continue Statement
      10. The del Statement
      11. The exec Statement
      12. The def Statement
        1. lambda expressions
        2. Function and method decorators
      13. The return Statement
      14. The yield Statement
        1. Generators and iterators
      15. The global Statement
      16. The import Statement
        1. Package imports
      17. The from Statement
      18. The class Statement
      19. The try Statement
      20. The raise Statement
        1. Class exceptions
      21. The assert Statement
    9. Namespace and Scope Rules
      1. Qualified Names: Object Namespaces
      2. Unqualified Names: Lexical Scopes
      3. Statically Nested Scopes
    10. Object-Oriented Programming
      1. Classes and Instances
        1. Class objects provide default behavior
        2. Instance objects are generated from classes
        3. Inheritance rules
      2. Pseudo-Private Attributes
        1. Module privates
        2. Class privates
      3. New Style Classes
    11. Operator Overloading Methods
      1. For All Types
      2. For Collections (Sequences, Mappings)
      3. For Numbers (Binary Operators)
        1. Basic binary methods
        2. Right-side binary methods
        3. Augmented binary methods
      4. For Numbers (Other Operations)
    12. Built-in Functions (1/3)
    13. Built-in Functions (2/3)
    14. Built-in Functions (3/3)
    15. Built-in Exceptions
      1. Base Classes (Categories)
      2. Specific Exceptions Raised
      3. Warning Category Exceptions
      4. Warnings Framework
    16. Built-in Attributes
    17. Built-in Modules
    18. The sys Module (1/2)
    19. The sys Module (2/2)
    20. The string Module
      1. Module Functions
      2. Constants
    21. The os System Module
      1. Administrative Tools
      2. Portability Constants
      3. Shell Commands
      4. Environment Tools
      5. File Descriptor Tools
      6. File Pathname Tools
      7. Process Control
      8. The os.path Module
    22. The re Pattern-Matching Module
      1. Module Functions
      2. Regular Expression Objects
      3. Match Objects
      4. Pattern Syntax
    23. Object Persistence Modules
      1. anydbm and shelve Interfaces
        1. Notes
      2. pickle Interface
        1. Notes
    24. Tkinter GUI Module and Tools
      1. Tkinter Example
      2. Tkinter Core Widgets
      3. Common Dialog Calls
        1. Module tkMessageBox
        2. Module tkSimpleDialog
        3. Module tkColorChooser
        4. Module tkFileDialog
      4. Additional Tkinter Classes and Tools
      5. Tcl/Tk-to-Python/Tkinter Mappings
    25. Internet Modules and Tools
      1. Commonly Used Library Modules
    26. Other Built-in Modules
      1. The math Module
      2. The time Module
      3. The datetime Module
      4. Threading Modules
      5. Binary Data Parsing
    27. Python Portable SQL Database API
      1. API Usage Example
      2. Module Interface
      3. Connection Objects
      4. Cursor Objects
      5. Type Objects and Constructors
    28. Python Idioms and Hints
      1. Core Language Hints
      2. Environment Hints
      3. Usage Hints
      4. Assorted Hints
  4. Index (1/2)
  5. Index (2/2)

Product information

  • Title: Python Pocket Reference, Third Edition
  • Author(s): Mark Lutz
  • Release date: February 2005
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596009403