Silly question; best way to run a python program from Vim?

Grégoire Dooms dooms at info.LESS.ucl.SPAM.ac.be
Sat Jun 12 06:33:54 EDT 2004


Kenneth McDonald wrote:
...

> 
> Thanks for the help. Of course, if you have other useful
> suggestions for using Vim with Python, please feel free
> to contribute those also.
> 

I have been using ipython + vim for over a year now and I'm quite happy 
with this.

I usually have both a vim and an ipython session running at the same 
time when coding. When I want to test/debug, I close my vim session and 
do the test/debug/edit cycle from within ipython. ipython has a special 
command called '@edit file' which launches you $EDITOR, let you change 
your code and runs the file once you exit the editor.

This plus the @pdb trick which launches pdb when an uncaught exception 
is raised fullfill my needs.

Moreover, ipython has command and filename completion, shell like 
commands (cd, ls, !), colorized magic help (object.method? pretty prints 
object.method.__doc__), etc....

ipython: http://ipython.scipy.org/

Hope this helps
--
Grégoire Dooms



More information about the Python-list mailing list