Contents
1: Python Primer
b'Chapter 1: Python Primer'
b'Python basic syntax and block structure'
b'Python's built-in data structures and comprehensions'
b'First-class functions and classes'
b'The standard library'
b'What's new in modern Python'
b'Summary'
2: Setting Up
b'Chapter 2: Setting Up'
b'Downloading and installing Python'
b'Using the command line and the interactive shell'
b'Installing packages with pip'
b'Finding packages in the Python Package Index'
b'Summary'
3: Making a Package
b'Chapter 3: Making a Package'
b'Creating an empty package'
b'Adding modules to the package'
b'Accessing code from other modules'
b'Adding static data files to the package'
b'Summary'
4: Basic Best Practices
b'Chapter 4: Basic Best Practices'
b'PEP 8 and writing readable code'
b'Using version control'
b'Using venv to create a stable and isolated work area'
b'Getting the most out of docstrings'
b'Summary'
5: Making a Command-Line Utility
b'Chapter 5: Making a Command-Line Utility'
b'Making a package executable via Python -m'
b'Handling command-line arguments with argparse'
b'Python tools to interact with the user'
b'Executing other programs with subprocess'
b'Setting up a shell script or batch file to launch the program'
b'Summary'
6: Parallel Processing
b'Chapter 6: Parallel Processing'
b'Using the concurrent.futures package'
b'Using the multiprocessing packages'
b'Summary'
7: Coroutines and Asynchronous I/O
b'Chapter 7: Coroutines and Asynchronous I/O'
b'The difference between asynchronous processing and parallel
processing'
b'Using the asyncio event loop and coroutine scheduler'
b'Awaiting data availability'
b'Synchronizing multiple tasks'
b'Communicating across the network'
8: Metaprogramming
b'Chapter 8: Metaprogramming'
b'Using function decorators'
b'Function annotations'
b'Class decorators'
b'Metaclasses'
b'Context managers'
b'Descriptors'
b'Summary'
9: Unit Testing
b'Chapter 9: Unit Testing'
b'Understanding the principle of unit testing'
b'Using the unittest package'
b'Using unittest.mock'
b'Using unittest's test discovery'
b'Using nose for unified test discovery and reporting'
b'Summary'
10: Reactive Programming
b'Chapter 10: Reactive Programming'
b'The concept of reactive programming'
b'Building a simple reactive programming framework'
b'Using the reactive extensions for Python (RxPY)'
b'Summary'
11: Microservices
b'Chapter 11: Microservices'
b'Microservices and the advantages of process isolation'
b'Building high-level microservices with Flask'
b'Building high-level microservices with nameko'
b'Summary'
12: Extension Modules and Compiled Code
b'Chapter 12: Extension Modules and Compiled Code'
b'Advantages and disadvantages of compiled code'
b'Accessing a dynamic library using ctypes'
b'Interfacing with C code using Cython'
b'Summary'
Chapter 1. Python Primer
In this chapter, we will be covering the basic syntax of Python, its built-in
data structures, functions, classes, its standard library, and the new features in
the latest versions of Python. If you need to get up to speed on the language,
this is where we'll do that. We'll walk through, step by step, covering the
following topics:
Python basic syntax and block structure
Built-in data structures and comprehensions
First-class functions and classes
Extensive standard library
What's new in Python