[Tutor] Best Python Editor

Wayne srilyk at gmail.com
Sun Jun 14 16:16:05 CEST 2009


On Sun, Jun 14, 2009 at 5:55 AM, 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.  My main issue is how do I
> go about using VIM to debug my code?


I usually use print statements and/or raw_input's if you want break points.


> With Pyscripter and other IDES its as simple as placing a breakpoint and
> pressing F7 to step thru the code and you have the ability to see the
> variable values etc.


I know you can do some similar things with the python debugger but I've
honestly never used it that much (or worked on a project large enough I
needed to!)


> Also, with an IDE such as Pyscripter when calling a function a nice balloon
> hint appears showing you the number of parameters and their types.


It's not precisely the same thing, but you can fold multiple lines, which
allows you to have only the top line of a function showing. I find that
rather helpful, and ctrl-n autocompletes the function name. Then you can
mark the location with m then a-to-z (I use c as a mnemonic for 'current')
then move on top of the name and push * - that will find the next occurence
of the word, which is often the function declaration. I just hit "n" (next)
until I find it, if that's not the case. Then I type ` (the one over the
tilde) then c which takes me back to my 'current' location. If you really
wanted, though, you could also have horizontal split of the same file, and
you could probably write a macro that would move to that window/buffer and
find the function declaraition (so it would search for def <whatever is
under cursor>). I don't know precisely how the dropdown autocomplete menu
works but you could also probably edit your script to add parameters for the
function call just like an IDE.


>   Coming from a Visual Studio background this is great, as I might be
> calling a function or method and I 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.  Don't 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.


I suppose that's probably the case for a few people - and certainly the
reason those tools exist in the first place. If I were working on a quite
large program I might consider using an IDE, but in reality I'm probably
just as comfortable jumping around code to look for the information I need
as I would be using an IDE.

HTH,
Wayne


> On Sun, Jun 14, 2009 at 12:54 AM, Eddie <eddie9139 at gmail.com> wrote:
>
>> I downloaded the previous version of PyScripter although couldn't get
>> it to work and after googling it, I downloaded Python Portable 1.1
>> (Python 2.6.1 as most sites/books recommend this and not 3) which has
>> PySCripter included and this then works fine.Ii also downloaded Komod0
>> 5.1 and after messing around with these, I think I prefer PyScripter
>> and will use that for the mean time.
>>
>> I'll also take a look at VIM as being able to use the same program for
>> PHP/CSS/HTML (and Basic if it supports it) as well as hopefully Python
>> (I've only just started learning it) would be an advantage.
>>
>> Thanks guys
>> Eddie
>>
>> 2009/6/14 Mike Hoy <hoym74 at gmail.com>:
>> >>
>> >>
>> >> I really like using F5 to run my code, so you can put in your .vimrc so
>> >> you don't have to type it, or just type it every time:
>> >>
>> >> map <F5> :!python %<Enter>
>> >>
>> >> and every time you hit <F5> it will run your current script.
>> >>
>> > Thanks for that. It's even better than typing :!python % because it
>> doesn't
>> > spawn a shell separate from the Vim window.
>> >
>> > _______________________________________________
>> > Tutor maillist  -  Tutor at python.org
>> > http://mail.python.org/mailman/listinfo/tutor
>> >
>> >
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>


-- 
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation, but stupidity hasn’t. - Primo Levi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090614/8747efe5/attachment-0001.htm>


More information about the Tutor mailing list