Python in Practice — book (original) (raw)
Create Better Programs Using Concurrency, Libraries, and Patterns
by Mark Summerfield
ISBN-10: 0321905636 – ISBN-13: 978-0321905635
Dr Dobbs JOLT best book award winner
Chapter 1 is available free fromInformIT; click the “Sample Content” tab, then scroll to the bottom and click the “Download the sample pages” link.
This book is aimed at existing Python programmers who want to take their Python programming to the next level. (Those new to Python 3 should read Programming in Python 3 first.)
The book's first few chapters show how to implement the programming_design patterns_ in Python 3 to produce more elegant and maintainable code. The book then goes on to look at how to improve program performance using concurrency, using external libraries written in C or C++, and using compiled Python. The book also introduces a couple of approaches to high-level networking that allow programmers to focus on their application logic and leave the low-level details to libraries. Then, the book introduces GUI programming with Tkinter. And the book finishes up with a chapter on 3D graphics using OpenGL.
The book is packed with examples that not only illustrate the major topics it covers, but which also demonstrate many useful Python features and idioms. The book also introduces many modules both from the standard library and from important third-party libraries.
The book is 336 pages, and is published by Addison-Wesley Professional. It can be bought fromInformIT, or from other online or local book stores.
Only the English printed editions are _definitive_—although available in electronic formats, "ebooks" usually restrict your rights, and they are often retypeset which can introduce errors. A legal PDF version is available fromInformIT. Translations are arranged by the publisher and their quality can vary considerably.
Q&A with 2014 Jolt Award Winner: "Python in Practice" Author.
Downloads
The book's examples are available in<pipbook-1.0.tar.gz> (274 KB) or <pipbook-1.0.zip> (419 KB).
Table of Contents
- Foreword by Doug Hellmann*
- Introduction
- Acknowledgements
- Chapter 1. Creational Design Patterns
- Abstract Factory Pattern
* A Classic Abstract Factory
* A More Pythonic Abstract Factory - Builder Pattern
- Factory Method Pattern
- Prototype Pattern
- Singleton Pattern
- Abstract Factory Pattern
- Chapter 2. Structural Design Patterns
- Adapter Pattern
- Bridge Pattern
- Composite Pattern
* A Classic Composite/Noncomposite Hierarchy
* A Single Class for (Non)Composites - Decorator Pattern
* Function and Method Decorators
* Class Decorators - Facade Pattern
- Flyweight Pattern
- Proxy Pattern
- Chapter 3. Behavioral Design Patterns
- Chain of Responsibility Pattern
* A Conventional Chain
* A Coroutine-based Chain - Command Pattern
- Interpreter Pattern
* Expression Evaluation with eval()
* Code Evaluation with exec()
* Code Evaluation using a Subprocess - Iterator Pattern
* Sequence Protocol Iterators
* Two-argument iter() Function Iterators
* Iterator Protocol Iterators - Mediator Pattern
* A Conventional Mediator
* A Coroutine-based Mediator - Memento Pattern
- Observer Pattern
- State Pattern
* Using State-Sensitive Methods
* Using State-Specific Methods - Strategy Pattern
- Template Method Pattern
- Visitor Pattern
- Case Study: An Image Package
- Chain of Responsibility Pattern
- Chapter 4. High-Level Concurrency
- CPU-bound Concurrency
* Using Queues and Multiprocessing
* Using Futures and Multiprocessing - I/O-bound Concurrency
* Using Queues and Threading
* Using Futures and Threading - Case Study: A Concurrent GUI Application
- CPU-bound Concurrency
- Chapter 5. Extending Python
- Accessing C Libraries with ctypes
- Using Cython
* Accessing c Libraries with Cython
* Writing Cython Modules for Greater Speed - Case Study: An Accelerated Image Package
- Chapter 6. High-Level Networking
- Writing XML-RPC Applications
* A Data Wrapper
* Writing XML-RPC Servers
* Writing XML-RPC Clients - Writing RPyC Applications
* A Thread-Safe Data Wrapper
* Writing RPyC Servers
* Writing RPyC Clients
- Writing XML-RPC Applications
- Chapter 7. Graphical User Interfaces with Tkinter
- Introduction to Tkinter
- Creating Dialogs with Tkinter
* Creating a Dialog-style Application
* Creating Application Dialogs - Creating Main Window Applications with Tkinter
* Creating a Main Window
* Creating Menus
* Creating a Status Bar with Indicators
- Chapter 8. OpenGL 3D Graphics
- A Perspective Scene
* Creating a Cylinder with PyOpenGL
* Creating a Cylinder with pyglet - An Orthographic Game
* Drawing the Board Scene
* Handling Scene Object Selection
* Handling User Interaction
- A Perspective Scene
- Appendix A: Epilogue
- Appendix B: Selected Bibliograpy
- Index
See also my Python Programming Tips.
For more about Python see www.python.org.
Two other useful books on Python 3, and worthy companions to this book are the Python Cookbook (3rd ed.) by David Beazley and Brian K. Jones, and Fluent Python by Luciano Ramalho.
Like all my books and most of my other writings, this book was written using the Lout Typesetting System.
This web page has been translated into Czech.
* Doug Hellman is a well known Python expert and author of The Python Standard Library by Example.
Your Privacy • Copyright © 2006 Mark Summerfield.All Rights Reserved.
