One of my favorite python development tools is RunSnakeRun, which is a GUI for visualizing profiling information. I usually use it to track down what's making a script run slow: the tool draws nexted blocks with a surface area roughly proportional to the time spent in a given function. In the above screenshot I learned that the python library for Google'sProtocol Buffers serialization format were the bottle neck for an experiment we were doing. We were sort of expecting networking or disk I/O to be the bottleneck, but with these libraries it was the CPU. The compiled C libraries are much faster!
The Python interpreter actually has the profiling code built in ("cProfile"), and runsnakerun is just a GUI for analysing the dump files. The commands I usually use to capture a dump and then visualize with runsnakerun are something like:
$ python -m cProfile -o ./dump.profile myscript.py --script-option blah $ # run to completion or Ctrl-C, then $ runsnakerun ./dump.profile
You can get install runsnakerun from the debian package repos (probably ubuntu also); details and installation instructions for other operating systems are avalable from the website.