PSU uses emacs?

Alex Martelli aleaxit at yahoo.com
Fri Jan 19 11:55:45 EST 2001


"Ray Drew" <ray_drew at yahoo.co.uk> wrote in message
news:3a685ef2.3403798 at reading.news.pipex.net...
    [snip]
> (on Win98)
> I've been using Idle but I'd like to try gvim. A few questions spring
> to mind...
>
> Do you use a command window for interactive sessions, or can you run
> an interpreter within gvim (as with emacs)? If you use a command
> window, how do you manage repeating previous code snippets?

I normally use a command window (occasionally PyWin or IDLE, while
still doing 'real' editing from gvim).  I repeat previous code
snippets with up-arrow (on NT); Win98 is really brain-damaged
(up-arrow doesn't work at Python prompt, while in NT it does) so
I'd use an alternate command processor there, which does give me
this minimal utility (there's one written in Python that I use on
win98 machines sometime, but I don't have an URL for it handy;
or else, bash or some of its workalikes).


> How do you debug... in the command window with pdb?

To be honest, more often I stick print statements in for debugging
purposes, but that's not a particularly clever idea, just the normal
reflex of a programming dinosaur (I do lots of OutputDebugString and
watch them with a separate utility too - I find that VERY handy since
so often I'm debugging joint Python and C/C++ code operation, and my
approach to debugging does tend to be 'check what this is worth right
here' which tracing facilities such as print and OutputDebugString
work well with).  pdb seems quite adequate too (when I'm debugging
only Python, not C/C++ written modules at the same time).


> Do you use the ole version to make it Python-programmable? Can you
> give a simple example of how this might be used?

Yes, and no, to the two questions.  I find the idea of a programmable
editor very cool, but (again being a dinosaur) I don't really make
much true use of it!-)


> Any other tips for using gvim with Python?

Use blank lines cleverly to delimit logical blocks, so { and } are
useful movement-commands -- also increases readability.  Would be
nice to have movement commands based on indent-levels, but, to be
quite honest with you, I've never bothered programming them...
(shame's about to engulf me...).  I like :set expandtab always
on -- no tab/space confusion; I also like :set ff unix, so that my
scripts can be shared between Win and Unix machines (and why
waste one byte per line to tell a 'carriage' that is not there
to 'return' [to where?]...?!-).

Oh, and the key tip for gvim under Win98 - the quoting character
is NOT control-V (they used that for 'paste' to follow Win
conventions) -- it's control-Q instead.  So to remove those
silly control-M (carriage-return) that using some other editor
may have inserted, :%s/^Q^M// is what one types (with ^ to mean
keeping the Ctrl key down:-).


Alex






More information about the Python-list mailing list