Qtrac Ltd.
Software
Courses
Books
Game
All Writing & Software
Privacy
Copyright © 2013 Qtrac Ltd.
All Rights Reserved.
Python in Practice
Create Better Programs Using Concurrency,
Libraries, and Patterns
by Mark Summerfield
ISBN-10: 0321905636 – ISBN-13:
978-0321905635
Chapter 1 is available free from
InformIT
; 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 examples' source
code will be downloadable from this page once the book is published.)
The book is 336 pages, and is published by Addison-Wesley Professional.
It can be ordered from
InformIT
,
Amazon.com
,
Amazon.co.uk
,
or from your preferred online or local book store.
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 from
InformIT
.
Translations are arranged by the publisher and their quality can vary
considerably.
Downloads
The source code is available in two formats,
pipbook-1.0.tar.gz (269K suitable for any
platform), and
pipbook-1.0.zip (411K Windows line
endings)
[updated 2013-10-22]—they are
GPL-licensed.
There is also an Errata
[updated 2013-10-22].
Reviews
Table of Contents
- Foreword by Doug Hellmann
- Introduction
- 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
- 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
- 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
- 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
- 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
- Appendix A: Epilogue
- Appendix B: Selected Bibliograpy
- Index
For more about Python see www.python.org.
Another very useful book on Python 3, and a worthy companion to
this book is the
Python
Cookbook (3rd ed.)
by David Beazley and Brian K. Jones.
Like all my books and most of my other writings, this book was written using The Lout
Typesetting System.
Top