I wanted to talk about my development environment for Python.
I do all my main development under MacOS X, but deploy to other UNIX
systems. I write all my code using Vim
. I don't use syntax coloring, nor do I use folding. Sometimes I'll
use a split buffer when I'm feeling daring.
I make heavy use of
to check my code before running it. I really love it because it catches all
of the stupid mistakes I make.
Like many python programmers, I spend a lot of time typing small code
snippets directly into the python interpreter just to test things. This
is amazingly useful. Beyond using tab-copletion with readline, I like
to have my python history saved between sessions, so I use this in my
from pydoc import help
# Make TAB complete stuff
# Save our interpreter history between sessions
historyPath = os.path.expanduser("~/.pyhistory")
# clean up
del os, atexit, readline, rlcompleter, save_history, historyPath
I didn't write those history saving bits myself. They were found on the
net. Score! I've recently tried using
IPython, an enhanced interactive
python shell. I haven't switched over to it yet, but I think it's @edit
command is really cool.
When it comes time to debug, I'm a big fan of just using print
statements. Beyond that, I like to use 'python -i' to inspect the state of
variables in the interpreter, and rarely I'll use 'pdb.run()' to run code
under the debugger.
That's basically it. Nothing fancy, but the job gets done.