Python in Practice: Create Better Programs Using Concurrency, Libraries, and Patterns

Overview

Winner of the 2014 Jolt Award for "Best Book"

“Whether you are an experienced programmer or are starting your career, Python in Practice is full of valuable advice and example to help you improve your craft by thinking about problems from different perspectives, introducing tools, and detailing techniques to create more effective solutions.”

Doug Hellmann, Senior Developer, DreamHost

If you’re an experienced ...

See more details below
Paperback (New Edition)
$32.56
BN.com price
(Save 27%)$44.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (12) from $31.98   
  • New (10) from $31.98   
  • Used (2) from $32.55   
Python in Practice: Create Better Programs Using Concurrency, Libraries, and Patterns

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$19.99
BN.com price
(Save 44%)$35.99 List Price

Overview

Winner of the 2014 Jolt Award for "Best Book"

“Whether you are an experienced programmer or are starting your career, Python in Practice is full of valuable advice and example to help you improve your craft by thinking about problems from different perspectives, introducing tools, and detailing techniques to create more effective solutions.”

Doug Hellmann, Senior Developer, DreamHost

If you’re an experienced Python programmer, Python in Practice will help you improve the quality, reliability, speed, maintainability, and usability of all your Python programs.

Mark Summerfield focuses on four key themes: design patterns for coding elegance, faster processing through concurrency and compiled Python (Cython), high-level networking, and graphics. He identifies well-proven design patterns that are useful in Python, illuminates them with expert-quality code, and explains why some object-oriented design patterns are irrelevant to Python. He also explodes several counterproductive myths about Python programming—showing, for example, how Python can take full advantage of multicore hardware.

All examples, including three complete case studies, have been tested with Python 3.3 (and, where possible, Python 3.2 and 3.1) and crafted to maintain compatibility with future Python 3.x versions. All code has been tested on Linux, and most code has also been tested on OS X and Windows. All code may be downloaded at www.qtrac.eu/pipbook.html.

Coverage includes

  • Leveraging Python’s most effective creational, structural, and behavioral design patterns
  • Supporting concurrency with Python’s multiprocessing, threading, and concurrent.futures modules
  • Avoiding concurrency problems using thread-safe queues and futures rather than fragile locks
  • Simplifying networking with high-level modules, including xmlrpclib and RPyC
  • Accelerating Python code with Cython, C-based Python modules, profiling, and other techniques
  • Creating modern-looking GUI applications with Tkinter
  • Leveraging today’s powerful graphics hardware via the OpenGL API using pyglet and PyOpenGL
Read More Show Less

Product Details

  • ISBN-13: 9780321905635
  • Publisher: Addison-Wesley
  • Publication date: 9/4/2013
  • Edition description: New Edition
  • Edition number: 1
  • Pages: 336
  • Sales rank: 351,592
  • Product dimensions: 7.00 (w) x 9.00 (h) x 0.80 (d)

Meet the Author

Mark Summerfield, owner of Qtrac Ltd., is an independent trainer, consultant, technical editor, and writer specializing in C++, Go, Python, Qt, and PyQt. His books include Rapid GUI Programming with Python and Qt; C++ GUI Programming with Qt 4, Second Edition (with Jasmin Blanchette); Programming inPython 3, Second Edition; and Advanced Qt Programming, and Programming in Go, all from Addison-Wesley.
Read More Show Less

Table of Contents

Foreword xiii

Introduction 1

Acknowledgments 3

Chapter 1: Creational Design Patterns 5

1.1. Abstract Factory Pattern 5

1.2. Builder Pattern 11

1.3. Factory Method Pattern 17

1.4. Prototype Pattern 24

1.5. Singleton Pattern 26

Chapter 2: Structural Design Patterns 29

2.1. Adapter Pattern 29

2.2. Bridge Pattern 34

2.3. Composite Pattern 40

2.4. Decorator Pattern 48

2.5. Façade Pattern 59

2.6. Flyweight Pattern 64

2.7. Proxy Pattern 67

Chapter 3: Behavioral Design Patterns 73

3.1. Chain of Responsibility Pattern 74

3.2. Command Pattern 79

3.3. Interpreter Pattern 83

3.4. Iterator Pattern 95

3.5. Mediator Pattern 100

3.6. Memento Pattern 106

3.7. Observer Pattern 107

3.8. State Pattern 111

3.9. Strategy Pattern 116

3.10. Template Method Pattern 119

3.11. Visitor Pattern 123

3.12. Case Study: An Image Package 124

Chapter 4: High-Level Concurrency 141

4.1. CPU-Bound Concurrency 144

4.2. I/O-Bound Concurrency 155

4.3. Case Study: A Concurrent GUI Application 164

Chapter 5: Extending Python 179

5.1. Accessing C Libraries with ctypes 180

5.2. Using Cython 187

5.3. Case Study: An Accelerated Image Package 198

Chapter 6: High-Level Networking 203

6.1. Writing XML-RPC Applications 204

6.2. Writing RPyC Applications 219

Chapter 7: Graphical User Interfaces with Tkinter 231

7.1. Introduction to Tkinter 233

7.2. Creating Dialogs with Tkinter 235

7.3. Creating Main-Window Applications with Tkinter 253

Chapter 8: OpenGL 3D Graphics 263

8.1. A Perspective Scene 264

8.2. An Orthographic Game 272

Appendix A: Epilogue 283

Appendix B: Selected Bibliography 285

Index 289

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)