Tools for Better Python
- pip install virtualenv pylint ipython autohook
Tools I use every day to write better Python, to make it more fun, or just easier:
- A good editor: I prefer Emacs, you might like something else, but trust me on this - it’ll be a humongous project that forces you to use a full IDE. If you stay clear of large web frameworks, you might never need it. I started out using PyDev since I was used to Eclipse, but now I just don’t think its worth the complexity and overhead.
- virtualenv: I use my virtualenvs for more than just Python these days, and setting a new environment up is the first thing I do when starting a new project.
- pylint: Not only does it tell you what you might want to fix in your code, it tells you if your code gets better or worse. The more unsure you are, the more you should use pylint.
- ipython: While REPL is nice, iPython is truly awesome for testing and prototyping. For me, its gradually replacing bash as well.
- unittest/unittest2: Python comes with built-in unit test support - use it (where appropriate)!
These are the tools I use in almost any project, and recently I’ve added one of my own:
- autohook, to run pylint/unit tests on commit to Mercurial
Finally, I’d like to point anyone starting out with Python to the excellent introduction set up by Mir Nazim at his site.