Bonus materials, exercises, and example projects for our Python tutorials
Real Python Materials
Bonus materials, exercises, and example projects for our Python tutorials.
Running Code Style Checks
Run the following commands to validate your code against the linters:
sh$ 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:
sh$ black .
To restore the repository download the bundle
git clone realpython-materials_-_2019-11-20_13-44-13.bundle