Use good tools¶
Use the tools introduced in each section¶
For your convenience, here is a list of tools and packages discussed in each section of the book.
Set up your project¶
Keep things tidy¶
- flake8 and pylint
command line linters for Python
a command line auto-formatter for Python code, with plugins for popular IDEs
a Python package to identify dead code in your codebase
a command line tool to seamlessly translate between regular jupyter notebooks and a markdown-based representation
Write decoupled code¶
Write good docs¶
a Python library to parse command-line arguments, part of the Python standard library
a command-line tool that checks for common errors in bash scripts, with plugins for popular IDEs
a command-line tool to define and run directed acyclic graphs of computation
a command-line tool to generate documentation from Python code and text files
a website to host documentation
Choose an IDE¶
Integrated development environments (IDE) can help you develop faster and make it easy to implement some of the productivity tips I’ve discussed previously. Preferred IDEs change from year to year, as new editors become favored while others are shunned. Don’t be surprised if in three years you’ll be using a different IDE.
I’ve evaluated many IDEs, and overall, I like vscode best. It’s open source, free, and fast. It has very good integrated Python development tools, and it has an impressive array of plugins for almost any imaginable use case. The git and github tools are particularly well integrated, which makes it easy to do source control outside of the command line. There is an integrated debugger, as well as a terminal, so it’s one-stop shop for development.
Others recommend PyCharm - it has best-in-class code understanding, and scales well to large codebases. It’s free for academics.
Use WSL on Windows¶
Windows’ basic terminal lacks basic features. Powershell is powerful but it is very different from other platforms. For a while, the best way to get a Unix-style shell on Windows was to use the git bash tool. In my opinion, these days the best-in-class terminal to use on Windows is Windows subsystem for Linux (WSL).
WSL is an emulation layer that allows you to run a full Linux kernel inside of a Windows terminal window. Once installed, you can install any Linux OS you like - Ubuntu being the de facto standard.
You won’t be able to run GUI applications. However, many tools you’ll want to use run webservers, for example jupyter - you’ll be able to access these through your your normal Windows-based web browser, such as Chrome, Firefox or Edge. Your Linux installation will run in a virtual filesystem, which you can access through Windows explorer by typing
explorer inside a WSL terminal.
code . will fire up a version of vscode in your current directory.