[Tutor] IDLE as battery included

Kirby Urner urnerk@qwest.net
Mon, 26 Nov 2001 12:14:56 -0800


>
>IDLE must be more broken than I thought.  I tested it with the
>interpreter running directly from a shell.  I don't have the idle
>package installed.
>
>-D

For all of its faults, I still consider IDLE one of those
"batteries included" features.  For someone just trying to
learn some Python, who isn't already a Vim or Emacs user,
adding these high end editors to the learning curve is just
a distraction.  IDLE gives you keyword color coding and
a shell.  It's adequate, not stellar.  Gets the job done.

That cut 'n paste weirdness had never come up for me before
cuz I'm always encapsulating code inside a def or class,
and every line under a def or class is by definition indented,
with if: clause stuff indented even more.  So if I paste
from an IDLE window to the shell, the indented lines might
move left a bit, but the function still works.  If not,
hitting return on any line repeats the function further down,
and this likely fixes the "extra space on the first line"
problem (different problem from the one described).

I encourage writing with the shell open and interacting
directly with code chunks in a neighboring module window,
using the reload cycle to debug, and passing parameters
directly to functions/classes to test the pieces.  I think
novices coming from Basic or whatever are likely to waste
to much time thinking in terms of scripts which prompt for
all the inputs, or have to execute top to bottom.  I find
it much cooler to treat my modules as mini-APIs and to
interact with the contents dynamically, without the script
orientation.  Saves a lot of time.

PyCrust, another GUI shell, is coming along.  It doesn't
include a text editor though.  Lots of folks use Scintilla
for Python.  There's a whole tier of middle-range program
editors, many of them easier to learn than either Vim or
Emacs, worth checking out, if you outgrow IDLE's "enough
to get you going" capabilities.

Kirby