Learning Python Application Development

Take Python beyond scripting to build robust, reusable, and efficient applications

Learning Python Application Development

This ebook is included in a Mapt subscription
Ninad Sathaye

1 customer reviews
Take Python beyond scripting to build robust, reusable, and efficient applications
$10.00
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook
Preview in Mapt

Book Details

ISBN 139781785889196
Paperback454 pages

Book Description

Python is one of the most widely used dynamic programming languages, supported by a rich set of libraries and frameworks that enable rapid development. But fast paced development often comes with its own baggage that could bring down the quality, performance, and extensibility of an application. This book will show you ways to handle such problems and write better Python applications.

From the basics of simple command-line applications, develop your skills all the way to designing efficient and advanced Python apps. Guided by a light-hearted fantasy learning theme, overcome the real-world problems of complex Python development with practical solutions. Beginning with a focus on robustness, packaging, and releasing application code, you’ll move on to focus on improving application lifetime by making code extensible, reusable, and readable. Get to grips with Python refactoring, design patterns and best practices. Techniques to identify the bottlenecks and improve performance are covered in a series of chapters devoted to performance, before closing with a look at developing Python GUIs.

Table of Contents

Chapter 1: Developing Simple Applications
Important housekeeping notes
Installation prerequisites
The theme of the book
Simple script – Attack of the Orcs v0.0.1
Using functions – Attack of the Orcs v0.0.5
Using OOP – Attack of the Orcs v1.0.0
Abstract base classes in Python
Summary
Chapter 2: Dealing with Exceptions
Revisiting Attack of the Orcs v1.0.0
Exceptions
Back to the game – Attack of the Orcs v1.1.0
Defining custom exceptions
Exercise
Summary
Chapter 3: Modularize, Package, Deploy!
Selecting a versioning convention
Modularizing the code
Creating a package
Releasing the package on PyPI
Using a private PyPI repository
Making an incremental release
Version controlling the code
Using GUI clients for Git
Exercise
Summary
Chapter 4: Documentation and Best Practices
Documenting the code
Python coding standards
Code analysis – How well are we doing?
Exercise
Summary
Chapter 5: Unit Testing and Refactoring
This is how the chapter is organized
Why test?
Unit testing
Writing unit tests for the application
Unit tests using mock library
Is your code covered?
Other unit testing tools
Refactoring preamble
Refactoring
Unit testing revisited
Exercise
Summary
Chapter 6: Design Patterns
Introduction to design patterns
Python language and design patterns
Structure of the rest of the chapter
Fast forward – Attack of the Orcs v6.0.0
Strategy pattern
Simple factory
Abstract factory pattern
Adapter pattern
Summary
Chapter 7: Performance – Identifying Bottlenecks
Overview of three performance chapters
Scenario – The Gold Hunt
The problem
Identifying the bottlenecks
Memory profiling
Algorithm efficiency and complexity
Big O notation
Summary
Chapter 8: Improving Performance – Part One
Prerequisite for the chapter
This is how the chapter is organized
Revisiting the Gold Hunt scenario
Optimizing Gold Hunt – Part one
Performance improvement goodies
Exercises
Summary
Chapter 9: Improving Performance – Part Two, NumPy and Parallelization
Prerequisites for this chapter
This is how the chapter is organized
Introduction to NumPy
Optimizing Gold Hunt – Part two
Parallelization with the multiprocessing module
Parallelizing the Gold Hunt program
Further reading
Summary
Chapter 10: Simple GUI Applications
Overview of GUI frameworks
GUI programming design considerations
Event-driven programming
GUI programming with Tkinter
Project-1 – Attack of the Orcs V10.0.0
MVC architecture
Project 2 – Attack of the Orcs v10.1.0
Testing GUI applications
Exercises
Further reading
Summary

What You Will Learn

  • Build a robust application by handling exceptions.
  • Modularize, package, and release the source distribution.
  • Document the code and implement coding standards.
  • Create automated tests to catch bugs in the early development stage.
  • Identify and re-factor badly written code to improve application life.
  • Detect recurring problems in the code and apply design patterns.
  • Improve code efficiency by identifying performance bottlenecks and fixing them.
  • Develop simple GUI applications using Python.

Authors

Table of Contents

Chapter 1: Developing Simple Applications
Important housekeeping notes
Installation prerequisites
The theme of the book
Simple script – Attack of the Orcs v0.0.1
Using functions – Attack of the Orcs v0.0.5
Using OOP – Attack of the Orcs v1.0.0
Abstract base classes in Python
Summary
Chapter 2: Dealing with Exceptions
Revisiting Attack of the Orcs v1.0.0
Exceptions
Back to the game – Attack of the Orcs v1.1.0
Defining custom exceptions
Exercise
Summary
Chapter 3: Modularize, Package, Deploy!
Selecting a versioning convention
Modularizing the code
Creating a package
Releasing the package on PyPI
Using a private PyPI repository
Making an incremental release
Version controlling the code
Using GUI clients for Git
Exercise
Summary
Chapter 4: Documentation and Best Practices
Documenting the code
Python coding standards
Code analysis – How well are we doing?
Exercise
Summary
Chapter 5: Unit Testing and Refactoring
This is how the chapter is organized
Why test?
Unit testing
Writing unit tests for the application
Unit tests using mock library
Is your code covered?
Other unit testing tools
Refactoring preamble
Refactoring
Unit testing revisited
Exercise
Summary
Chapter 6: Design Patterns
Introduction to design patterns
Python language and design patterns
Structure of the rest of the chapter
Fast forward – Attack of the Orcs v6.0.0
Strategy pattern
Simple factory
Abstract factory pattern
Adapter pattern
Summary
Chapter 7: Performance – Identifying Bottlenecks
Overview of three performance chapters
Scenario – The Gold Hunt
The problem
Identifying the bottlenecks
Memory profiling
Algorithm efficiency and complexity
Big O notation
Summary
Chapter 8: Improving Performance – Part One
Prerequisite for the chapter
This is how the chapter is organized
Revisiting the Gold Hunt scenario
Optimizing Gold Hunt – Part one
Performance improvement goodies
Exercises
Summary
Chapter 9: Improving Performance – Part Two, NumPy and Parallelization
Prerequisites for this chapter
This is how the chapter is organized
Introduction to NumPy
Optimizing Gold Hunt – Part two
Parallelization with the multiprocessing module
Parallelizing the Gold Hunt program
Further reading
Summary
Chapter 10: Simple GUI Applications
Overview of GUI frameworks
GUI programming design considerations
Event-driven programming
GUI programming with Tkinter
Project-1 – Attack of the Orcs V10.0.0
MVC architecture
Project 2 – Attack of the Orcs v10.1.0
Testing GUI applications
Exercises
Further reading
Summary

Book Details

ISBN 139781785889196
Paperback454 pages
Read More
From 1 reviews

Read More Reviews