Aside from learning the Python language itself, I have to learn on the go during daily business how to solve real-life problems with Python and share solutions with other colleagues.
Therefore I want while starting my projects from scratch, bootstrap them already with an advanced level for good readability1 and unit testing and have a more or less convenient efficient environment (besides what is the matter of taste, error-prone and well-readable code is here in focus).
Here is what I have found so far - what else would you add?
- Install not Python itself but the Anaconda distro
- Organize project in a comprehensive well-explained structure:
- Python project HowTo - Anatomy of a Python project and test methods
- Document your code - docstring conventions (PEP 257)
- If you are coming from an object-oriented language, consider Python object and classes
- Control code quality:
- Use pylint to check the quality of code, Anaconda has it already on-board
- Read about Python anti-patterns
- Consider to add a Dockerfile will required dependencies to demo how your tests run through in a given operating system environment
There is also a useful info on what modules' __init__.py
file could contain.
Answers welcome also pointing out what are Python specific but tool-neutral aspects to consider while integrating with a DevOps toolchain i.e. source control, continuous integration and binary package management.
1 I've noticed that the tag clean code
and related are leading to opinionated discussions; so I have decided to follow where possible recommendations available from Google, PEP, and pylint.