Also consider using pep8 style guide:
http://blog.sideci.com/2015/12/14/style-guide-of-python-and-lint-tool/
—
Below is the reference guide to Python that I wish had existed when I was learning the language.
Here’s what I want in a reference guide:
- High-quality examples that show the simplest possible usage of a given feature
- Explanatory comments, and descriptive variable names that eliminate the need for some comments
- Presented as a single script (or notebook), so that I can keep it open and search it when needed
- Code that can be run from top to bottom, with the relevant objects defined nearby
This is not written as a full-fledged Python tutorial, though I ordered the topics such that you can read it like a tutorial (i.e., each topic depends only on material preceding it).
The guide was written using Python 2 but is fully compatible with Python 3. Relevant differences between Python 2 and 3 are noted throughout the guide.
View/Download the Reference Guide
You can view it as a Python script on GitHub. It’s also embedded below this blog post.
You can view it as a Jupyter notebook on nbviewer.
If you want to save a copy of either the script or the notebook, just clone or download theGitHub repository.
Source: Quick reference to Python in a single script (and notebook)