
Learning Python
Publisher: O'Reilly Media
Release Date: April 1999
Pages: 384
Read on Safari with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything on Safari. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
- It is available on all important platforms: Windows NT, Windows 95, Windows 98, Linux, all major UNIX platforms, MacOS, and even the BeOS.
- It is open-source software, copyrighted but freely available for use, even in commercial applications.
- Its clean object-oriented interface makes it a valuable prototyping tool for C++ programmers.
- It works well with all popular windowing toolkits, including MFC, Tk, Mac, X11, and Motif. Learning Python is written by Mark Lutz, author of Programming Python and Python Pocket Reference; and David Ascher, a vision scientist and Python user. This book starts with a thorough introduction to the elements of Python: types, operators, statements, classes, functions, modules, and exceptions. By reading the first part of the book, the reader will be able to understand and construct programs in the Python language. In the second part of the book, the authors present more advanced information, demonstrating how Python performs common tasks and presenting real applications and the libraries available for those applications. All the examples use the Python interpreter, so the reader can type them in and get instant feedback. Each chapter ends with a series of exercises. Solutions to the exercises are in an appendix.
Table of Contents
-
The Core Language
-
Chapter 1 Getting Started
- Why Python?
- How to Run Python Programs
- A First Look at Module Files
- Python Configuration Details
- Summary
- Exercises
-
Chapter 2 Types and Operators
- Python Program Structure
- Why Use Built-in Types?
- Numbers
- Strings
- Lists
- Dictionaries
- Tuples
- Files
- General Object Properties
- Built-in Type Gotchas
- Summary
- Exercises
-
Chapter 3 Basic Statements
- Assignment
- Expressions
- if Tests
- while Loops
- for Loops
- Common Coding Gotchas
- Summary
- Exercises
-
Chapter 4 Functions
- Why Use Functions?
- Function Basics
- Scope Rules in Functions
- Argument Passing
- Odds and Ends
- Function Gotchas
- Summary
- Exercises
-
Chapter 5 Modules
- Why Use Modules?
- Module Basics
- Module Files Are Namespaces
- Import Model
- Reloading Modules
- Odds and Ends
- Module Gotchas
- Summary
- Exercises
-
Chapter 6 Classes
- Why Use Classes?
- Class Basics
- Using the Class Statement
- Using Class Methods
- Inheritance Searches Namespace Trees
- Operator Overloading in Classes
- Namespace Rules: The Whole Story
- Designing with Classes
- Odds and Ends
- Class Gotchas
- Summary
- Exercises
-
Chapter 7 Exceptions
- Why Use Exceptions?
- Exception Basics
- Exception Idioms
- Exception Catching Modes
- Odds and Ends
- Exception Gotchas
- Summary
- Exercises
-
-
The Outer Layers
-
Chapter 8 Built-in Tools
- Aside: The sys Module
- Built-in Functions
- Library Modules
- Exercises
-
Chapter 9 Common Tasks in Python
- Data Structure Manipulations
- Manipulating Files
- Manipulating Programs
- Internet-Related Activities
- Bigger Examples
- Exercises
-
Chapter 10 Frameworks and Applications
- An Automated Complaint System
- Interfacing with COM: Cheap Public Relations
- A Tkinter-Based GUI Editor for Managing Form Data
- Design Considerations
- JPython: The Felicitous Union of Python and Java
- Other Frameworks and Applications
- Exercises
-
-
Appendixes
-
Appendix Python Resources
- The Python Language Web Site
- Python Software
- Python Documentation and Books
- Newsgroups, Discussion Groups, and Email Help
- Conferences
- Support Companies, Consultants, Training
- Tim Peters
-
Appendix Platform-Specific Topics
- Unix
- Windows-Specific Information
- Macintosh-Specific Information
- Java
- Other Platforms
-
Appendix Solutions to Exercises
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
-
-
Colophon