Skip to content
Bonus materials, exercises, and example projects for our Python tutorials
Branch: master
Clone or download
Latest commit 62c9d37 Jun 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Fix CI caching May 9, 2019
.github Update PULL_REQUEST_TEMPLATE.md Apr 30, 2019
asyncio-walkthrough BinaryIO -> IO Nov 4, 2018
build-a-gui-with-wxpython Run black Jan 22, 2019
concurrency-overview Update tutorial link Jun 13, 2019
django-migrations Fixed more linter errors Feb 8, 2019
flask-connexion-rest-part-2 id vs person_id typo Jun 1, 2019
flask-connexion-rest-part-3 Remove venv files Jun 4, 2019
flask-connexion-rest Reformat using black Oct 9, 2018
flask-google-login change button text May 23, 2019
geoshops Fix black check Apr 30, 2019
histograms Reformat using black Oct 9, 2018
intro-to-bokeh Merge branch 'master' of github.com:realpython/materials Feb 6, 2019
intro-to-threading Use object() for sentinel value in threading article Mar 25, 2019
itertools-in-python3 Reformat using black Oct 9, 2018
nearbyshops Update readme.md Dec 13, 2018
oop-in-java-vs-python Final typo Mar 26, 2019
opencv-color-spaces Reformat using black Oct 9, 2018
pandas-fast-flexible-intuitive Reformat using black Oct 9, 2018
primer-on-python-decorators Reformat using black Oct 9, 2018
pygame-a-primer Minor formatting issues May 10, 2019
python-sockets-tutorial Fix flake8 violation Dec 12, 2018
python-type-checking Add materials for type checking article Jan 5, 2019
random-data Reformat using black Oct 9, 2018
rp-portfolio reformat with black Dec 18, 2018
serverless-sms-service Update README.md Mar 5, 2019
storing-images Reformat May 9, 2019
understanding-asynchronous-programming Remove local folder .gitignore Jun 4, 2019
.gitignore Restored the flask-connexion-rest directory, and created new director… Aug 8, 2018
LICENSE Initial commit May 6, 2018
README.md Update README.md Apr 30, 2019
pyproject.toml Resolve flake8 <-> black conflicts May 9, 2019
requirements.txt Resolve flake8 <-> black conflicts May 9, 2019
setup.cfg Resolve flake8 <-> black conflicts May 9, 2019

README.md

Real Python Materials

Bonus materials, exercises, and example projects for our Python tutorials.

Build Status: CircleCI

Running Code Style Checks

We use flake8 and black to ensure a consistent code style for all of our sample code in this repository.

Run the following commands to validate your code against the linters:

$ flake8
$ black --check .

Running Python Code Formatter

We're using a tool called black on this repo to ensure consistent formatting. On CI it runs in "check" mode to ensure any new files added to the repo are following PEP 8. If you see linter warnings that say something like "would reformat some_file.py" it means black disagrees with your formatting.

The easiest way to resolve these errors is to just run Black locally on the code and then committing those changes, as explained below.

To automatically re-format your code to be consistent with our code style guidelines, run black in the repository root folder:

$ black .
You can’t perform that action at this time.