Synopses & Reviews
Learning Python is an introduction to the increasingly popular Python programming language. Python is an interpreted, interactive, object-oriented scripting language. Python is growing in popularity because:
- 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 ofProgramming 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.
"Learning Python" is an introduction to the increasingly popular Python programming language--an interpreted, interactive, object-oriented, and portable scripting language. This book thoroughly introduces the elements of Python. It also demonstrates how to perform common programming tasks and write real applications.
About the Author
Mark Lutz is a leading Python trainer, the author of Pythons earliest and best-selling texts, and a pioneering figure in the Python world.
Mark is the author of the three OReilly books: Learning Python, Programming Python, and Python Pocket Reference, all currently in fourth or fifth editions. He has been using and promoting Python since 1992, started writing Python books in 1995, and began teaching Python classes in 1997. As of Spring 2013, Mark has instructed 260 Python training sessions, taught roughly 4,000 students in live classes, and written Python books that have sold 400,000 units and been translated to at least a dozen languages.
Together, his two decades of Python efforts have helped to establish it as one of the most widely used programming languages in the world today. In addition, Mark has been in the software field for 30 years. He holds BS and MS degrees in computer science from the University of Wisconsin where he explored implementations of the Prolog language, and over his career has worked as a professional software developer on compilers, programming tools, scripting applications, and assorted client/server systems.
Mark maintains a training w
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.
Table of Contents
Preface; About This Book; Font Conventions; About the Programs in This Book; How to Contact Us; Acknowledgments; The Core Language; Chapter 1: Getting Started; 1.1 Why Python?; 1.2 How to Run Python Programs; 1.3 A First Look at Module Files; 1.4 Python Configuration Details; 1.5 Summary; 1.6 Exercises; Chapter 2: Types and Operators; 2.1 Python Program Structure; 2.2 Why Use Built-in Types?; 2.3 Numbers; 2.4 Strings; 2.5 Lists; 2.6 Dictionaries; 2.7 Tuples; 2.8 Files; 2.9 General Object Properties; 2.10 Built-in Type Gotchas; 2.11 Summary; 2.12 Exercises; Chapter 3: Basic Statements; 3.1 Assignment; 3.2 Expressions; 3.3 Print; 3.4 if Tests; 3.5 while Loops; 3.6 for Loops; 3.7 Common Coding Gotchas; 3.8 Summary; 3.9 Exercises; Chapter 4: Functions; 4.1 Why Use Functions?; 4.2 Function Basics; 4.3 Scope Rules in Functions; 4.4 Argument Passing; 4.5 Odds and Ends; 4.6 Function Gotchas; 4.7 Summary; 4.8 Exercises; Chapter 5: Modules; 5.1 Why Use Modules?; 5.2 Module Basics; 5.3 Module Files Are Namespaces; 5.4 Import Model; 5.5 Reloading Modules; 5.6 Odds and Ends; 5.7 Module Gotchas; 5.8 Summary; 5.9 Exercises; Chapter 6: Classes; 6.1 Why Use Classes?; 6.2 Class Basics; 6.3 Using the Class Statement; 6.4 Using Class Methods; 6.5 Inheritance Searches Namespace Trees; 6.6 Operator Overloading in Classes; 6.7 Namespace Rules: The Whole Story; 6.8 Designing with Classes; 6.9 Odds and Ends; 6.10 Class Gotchas; 6.11 Summary; 6.12 Exercises; Chapter 7: Exceptions; 7.1 Why Use Exceptions?; 7.2 Exception Basics; 7.3 Exception Idioms; 7.4 Exception Catching Modes; 7.5 Odds and Ends; 7.6 Exception Gotchas; 7.7 Summary; 7.8 Exercises; The Outer Layers; Chapter 8: Built-in Tools; 8.1 Aside: The sys Module; 8.2 Built-in Functions; 8.3 Library Modules; 8.4 Exercises; Chapter 9: Common Tasks in Python; 9.1 Data Structure Manipulations; 9.2 Manipulating Files; 9.3 Manipulating Programs; 9.4 Internet-Related Activities; 9.5 Bigger Examples; 9.6 Exercises; Chapter 10: Frameworks and Applications; 10.1 An Automated Complaint System; 10.2 Interfacing with COM: Cheap Public Relations; 10.3 A Tkinter-Based GUI Editor for Managing Form Data; 10.4 Design Considerations; 10.5 JPython: The Felicitous Union of Python and Java; 10.6 Other Frameworks and Applications; 10.7 Exercises; Appendixes; 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; Platform-Specific Topics; Unix; Windows-Specific Information; Macintosh-Specific Information; Java; Other Platforms; Solutions to Exercises; Chapter 1; Chapter 2; Chapter 3; Chapter 4; Chapter 5; Chapter 6; Chapter 7; Chapter 8; Chapter 9; Chapter 10; Colophon;