[Tutor] Best Python Editor

Alan Gauld alan.gauld at btinternet.com
Sun Jun 14 17:04:35 CEST 2009

"Tom Green" <xchimeras at gmail.com> wrote

> Since VIM seems to be the editor of choice and I have been programming in
> Python for many years using Pyscripter and Eclipse I was wondering how I
> could transition away from the IDE world to VIM.

With great difficulty and to be honest I wouyldn't bother.
If you are used to eclipse then there is little to be gained from moving to 
vim is a more powerful and faster editor once you know it, but learning
it takes a while. But the "Microsoft IDE" v the "Unix style" of programming
are fundamentally different paradigms and if you are already comfortable
with an IDE I'd stick with that style. Particul;arly with Eclipse which is 
platform and therefore available on most OS.

> My main issue is how do I go about using VIM to debug my code?

You set up a key mapping to either start the Python debugger or one
of the GUI variants such as winpdb. To be honest the great thing about
Python is you hardly ever need a debugger, especially if you are
programming interactively using the >>> prompt (or IPython etc)

> have the ability to see the variable values etc.

Get to know the introspection capabilities of Python, dir() help() etc

> Pyscripter when calling a function a nice balloon hint appears showing 
> you
> the number of parameters and their types.

Tooltip help is the biggest single reason for using an IDE. It is genuinely
useful and not available on any straight editor I know of. However if you
are using a >>> prompt you can type help() to get the same info, but
it is slower. But if you are familiar with Python and its libraries its not
needed all that often. (And some people do get irritated by tooltips,
I used to in Delphi when I was an expert and I turned them off but now,
as an occasional programmer I do find them helpful)

> don't know off hand the values.  Maybe someone could share how they go 
> about
> programming a good size program with VIM as I would like to use it.

You program the modules in small chunks. You design the structure
of the program and build it bottom up. And I use the >>> prompt for ad-hoc
testing and experimentation a lot. I bounce between the OS shell (to
execute the program(*), the Python shell to try out code ideas, and
the editor.

(*) Some prefer to run the code from inside the editor but I find that
loses the output which is often what I want to see so I use a separate
OS window. That also means there is no strange environmental
stuff altering the behaviour.

> get me wrong for quick programs I will use VIM or notepad, but when it 
> comes
> to building a OOP program I find Eclipse or Pyscripter much easier to 
> use.

See I'm the opposite, I use Pythonwin or Eclipse for building small
programs but bigger things with multiple modukles I go for vim or Scite.
PyScripter looks like it might just win me over if I persevere, pity I 
get the debugger to work at all...

Some of this might just be what we are used to too. Remember that
IDEs as such didn't really come into existence till about 12-15 years
ago. Those of us who have notched up more than 2 or 3 decades of
coding have probably just not got used to the new concepts yet!
Unix was the original IDE! :-)


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list