Appendix A. Additional Notes

Python’s Community

Python has a rich, inclusive, global community dedicated to diversity.

BDFL

Guido van Rossum, the creator of Python, is often referred to as the BDFL—the Benevolent Dictator for Life.

Python Software Foundation

The mission of the Python Software Foundation (PSF) is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers. To learn more, see the PSF’s main page.

PEPs

PEPs are Python Enhancement Proposals. They describe changes to Python itself, or the standards around it. People interested in Python’s history, or in language design in general, would find them all really interesting—even the ones that eventually get rejected. There are three different types of PEPs, defined in PEP 1:

Standards

Standards PEPs describe a new feature or implementation.

Informational

Informational PEPs describe a design issue, general guidelines, or information to the community.

Process

Process PEPs describe a process related to Python.

Notable PEPs

There are a few PEPs that could be considered required reading:

PEP 8—Style Guide for Python Code

Read this. All of it. Follow it. The pep8 tool will help.

PEP 20—The Zen of Python

PEP 20 is a list of 19 statements that briefly explain the philosophy behind Python.

PEP 257—Docstring conventions

PEP 257 contains the guidelines for semantics and conventions associated with Python docstrings.

You can read more at the PEP index.

Submitting a PEP

PEPs are peer reviewed and accepted/rejected after much discussion. Anyone can write and submit a PEP for review. The diagram in Figure A-1 illustrates what happens after a draft PEP is submitted.

PEP acceptance workflow
Figure A-1. Overview of the PEP review process

Python conferences

The major events for the Python community are developer conferences. The two most notable conferences are PyCon, which is held in the United States, and its European sibling, EuroPython. A comprehensive list of conferences is maintained at http://www.pycon.org/.

Python user groups

User groups are where Python developers meet in person to present or talk about Python topics of interest. A list of local user groups is maintained at the Python Software Foundation wiki.

Learning Python

These are some of our favorite references, grouped by level and application.

Beginners

The Python Tutorial

This is Python’s official tutorial. It covers all the basics and offers a tour of the language and the Standard Library. Recommended for those who need a quick-start guide to the language.

Python for Beginners

This tutorial focuses on beginner programmers. It covers many Python concepts in depth. It also teaches you some advanced constructs in Python like lambda expressions and regular expressions. It concludes with the tutorial “How to access a MySQL db using Python.”

Learn Python

This interactive tutorial is an easy, nonintimidating way to get introduced to Python. It takes the same approach used on the popular website Try Ruby—there is an interactive Python interpreter built into the site that allows you to go through the lessons without having to install Python locally.

Python for You and Me

This book is an excellent resource for learning all aspects of the language and is good for those who prefer learning from a traditional book rather than a tutorial.

Online Python Tutor

This site gives you a visual step-by-step representation of how your program runs. Python Tutor helps people overcome a fundamental barrier to learning programming by understanding what happens as the computer executes each line of a program’s source code.

Invent Your Own Computer Games with Python

This book is for those with no programming experience at all. Each chapter has the source code for a game, and these example programs are used to demonstrate programming concepts to give the reader an idea of what programs “look like.”

Hacking Secret Ciphers with Python

This book teaches Python programming and basic cryptography for absolute beginners. The chapters provide the source code for various ciphers, as well as programs that can break them.

Learn Python the Hard Way

This is an excellent beginner programmer’s guide to Python. It covers “hello world” from the console to the Web.

Crash into Python

This site, also known as Python for Programmers with 3 Hours, gives developers who have experience with other languages a crash course on Python.

Dive Into Python 3

This book is good for those ready to jump into Python 3. It’s a good read if you are moving from Python 2 to 3 or if you already have some experience programming in another language.

Think Python: How to Think Like a Computer Scientist

This book attempts to give an introduction to basic concepts in computer science through the use of the Python language. The focus was to create a book with plenty of exercises, minimal jargon, and a section in each chapter devoted to debugging. It explores the various features available in the Python language and weaves in various design patterns and best practices.

The book also includes several case studies which have the reader explore the topics discussed in the book in greater detail by applying those topics to real-world examples. Case studies include designing a GUI and Markov Analysis.

Python Koans

This online tutorial is a Python version of Edgecase’s popular Ruby Koans. It’s an interactive command-line tutorial teaching basic Python concepts using a test-driven approach: by fixing assertion statements that fail in a test script, the student progresses in sequential steps to learning Python.

For those accustomed to languages and figuring out puzzles on their own, this can be a fun, attractive option. For those new to Python and programming, having an additional resource or reference will be helpful.

A Byte of Python

This is a free introductory book that teaches Python at the beginner level—it assumes no previous programming experience. There is an a version for Python 2.x and a version for Python 3.x

Learn to Program in Python with Codecademy

This Codecademy course is for the absolute Python beginner. This free and interactive course provides and teaches the basics (and beyond) of Python programming while testing the student’s knowledge as she progresses through the tutorials. It also also features a built-in interpreter for receiving instant feedback on your coursework.

Intermediate

Effective Python

This book contains 59 specific ways to improve writing Pythonic code. At 227 pages, it is a very brief overview of some of the most common adapations programmers need to make to become efficient intermediate-level Python programmers.

Advanced

Pro Python

This book is for intermediate to advanced Python programmers who are looking to understand how and why Python works the way it does and how they can take their code to the next level.

Expert Python Programming

This book deals with best practices in programming Python, and is focused on the more advanced crowd. It starts with topics like decorators (with caching, proxy, and context manager case studies), method resolution order, using super() and meta-programming, and general PEP 8 best practices.

It has a detailed, multichapter case study on writing and releasing a package and eventually an application, including a chapter on using zc.buildout. Later chapters detail best practices such as writing documentation, test-driven development, version control, optimization, and profiling.

A Guide to Python’s Magic Methods

This handy resource is a collection of blog posts by Rafe Kettler that explain “magic methods” in Python. Magic methods are surrounded by double underscores (e.g., __init__) and can make classes and objects behave in different and magical ways.

For Engineers and Scientists

Effective Computation in Physics

This field guide, by Anthony Scopatz and Kathryn D. Huff, is intended for early graduate students who are starting to use Python in any scientific or engineering field. It includes snippets for searching through files using SED and AWK, and provides tips on how to accomplish every step in the research chain, from data collection and analysis to publication.

A Primer on Scientific Programming with Python

This book, by Hans Petter Langtangen, mainly covers Python’s usage in the scientific field. In the book, examples are chosen from mathematics and the natural sciences.

Numerical Methods in Engineering with Python

This book by Jaan Kiusalaas puts the emphasis on modern numerical methods and how to implement them in Python.

Annotated Algorithms in Python: with Applications in Physics, Biology, and Finance

This tome, by Massimo Di Pierro, is a teaching tool intended to demonstrate the algorithms used by implementing them in straightforward ways.

Miscellaneous Topics

Problem Solving with Algorithms and Data Structures

This book covers a range of data structures and algorithms. All concepts are illustrated with Python code along with interactive samples that can be run directly in your browser.

Programming Collective Intelligence

This book introduces a wide array of basic machine learning and data mining methods. The exposition is not very mathematically formal, but rather focuses on explaining the underlying intuition and shows how to implement the algorithms in Python.

Transforming Code into Beautiful, Idiomatic Python

This video, by Raymond Hettinger, will show you how to take better advantage of Python’s best features and improve existing code through a series of code transformations: “When you see this, do that instead.”

Fullstack Python

This site offers a complete top-to-bottom resource for web development using Python from setting up the web server, to designing the frontend, choosing a database, optimizing/scaling, and more. As the name suggests, it covers everything you need to build and run a complete web app from scratch.

References

Python in a Nutshell

This book covers most cross-platform Python usage, from its syntax, to built-in libraries, to advanced topics such as writing C extensions.

The Python Language Reference

This is Python’s online reference manual. It covers the syntax and the core semantics of the language.

Python Essential Reference

This book, written by David Beazley, is the definitive reference guide to Python. It concisely explains both the core language and the most essential parts of the Standard Library. It covers Python 3 and Python 2.6.

Python Pocket Reference

This book, written by Mark Lutz, is an easy-to-use reference to the core language, with descriptions of commonly used modules and toolkits. It covers Python 3 and Python 2.6.

Python Cookbook

This book, written by David Beazley and Brian K. Jones, is packed with practical recipes. It covers the core Python language as well as tasks common to a wide variety of application domains.

Writing Idiomatic Python

This book, by Jeff Knupp, contains the most common and important Python idioms in a format that maximizes identification and understanding. Each idiom is presented as a recommendation of a way to write some commonly used piece of code, followed by an explanation of why the idiom is important. It also contains two code samples for each idiom: the “harmful” way to write it and the “idiomatic” way. There are different editions for Python 2.7.3+ and for Python 3.3+.

Documentation

Official documentation

The official Python Language and Library documentation can be found here for Python 2.x, and here for Python 3.x.

Official packaging documentation

The most current instructions for packaging your Python code will always be in Python’s official packaging guide. And remember that testPyPI exists so you can confirm that your packaging works.

Read the Docs

Read the Docs is a popular community project that hosts documentation for open source software. It holds documentation for many Python modules, both popular and exotic.

pydoc

pydoc is a utility that is installed when you install Python. It allows you to quickly retrieve and search for documentation from your shell. For example, if you needed a quick refresher on the time module, pulling up documentation would be as simple as typing this into a command shell:

$ pydoc time

which is essentially equivalent to opening the Python REPL and running:

>>> help(time)*

News

Our favorite places to get Python news are listed here in alphabetical order:

Name Description

/r/python

The Reddit Python community where users contribute and vote on Python-related news.

Import Python Weekly

A weekly newsletter containing Python articles, projects, videos, and tweets.

Planet Python

An aggregate of Python news from a growing number of developers.

Podcast.__init__

A weekly podcast about Python and the people who make it great.

Pycoder’s Weekly

A free weekly Python newsletter for Python developers by Python developers (it highlights interesting projects and includes articles, news, and a jobs board).

Python News

The news section in the official Python website. It briefly highlights the news from the Python community.

Python Weekly

A free weekly newsletter featuring curated news, articles, new releases, and jobs related to Python.

Talk Python to Me

A podcast on Python and related technologies.