Specific features

Async and concurrency

Command line applications

  • Python docs HOWTOs: Argparse Tutorial
  • click — creating beautiful command line interfaces in a composable way with as little code as necessary
  • Rich — make your command line applications visually appealing and present data in a more readable way
  • Textual — Text User Interface framework for Python inspired by modern web development

Context managers

Decorators and closures

Iterables, Generators, Yield, Itertools

Lambda

Lists and comprehensions

Memoization

OS interaction

Pattern matching

Profiling code and speeding up Python

Regular Expressions

  • Python re(gex)? — my book on regular expressions, covers built-in re and third-party regex modules
  • regex101 — visual aid and online testing tool for regular expressions, select flavor as Python before use
  • debuggex — railroad diagrams for regular expressions, select flavor as Python before use
  • Awesome Regex — curated collection of libraries, tools, frameworks and software

Type annotations

Virtual Environments and Packaging

On newer versions of Python, I use the simple commands shown below to create a new virtual environment. This approach should work out-of-the-box, but might depend upon the OS you are using. I'm on Linux.

# this is needed only once
# 'new_project' is the name of the folder, can be new or already existing
# use py instead of python3.9 for Windows
$ python3.9 -m venv new_project

$ cd new_project/
$ source bin/activate
(new_project) $ # pip install <modules>
(new_project) $ # do some scripting
(new_project) $ deactivate
$ # you're now out of the virtual environment

Here's some resources on this messy topic: