[Idle-dev] IDLEfork and ps2 prompt

Jean-Michel Fauth jmfauth@bluewin.ch
Fri, 24 Jan 2003 22:58:49 +0100


Hi all,

python 2.2.1, win98SE, IDLEfork 0.9a1

Nice to see an improvment of IDLE. I just want to point
something I do not like in the shell window. The ps2 prompt
('...') has deseappeared. I think this is a big mistake. In
a language, where identation is very important, a user
should be able to "see" a correct identation. Such an
argument is specially valid for beginners, who start
learning python using the shell. Indeed, in idlefork (and
IDLE), it is possible to code things like this:

>>> for i in range(3):
            print i           #height spaces
this is working correctly

>>> for i in range(3):
       print i               #four spaces
this is working too, but it should not

Now look at this:
>>> for i in range(3):
       print 'i=', i
       for j in range(3):
            print 'j=', j
Again, this is working perfectly.

My conclusion:
Python is a nice language, a good language to learn (and
teach) programming.
Keep the idle conform to the python language. Reintroduce
the '...' prompt. It will be easier for python beginners and
programmer beginners.
When I introduce python to a new user, I sometimes redefined
the ps1 prompt like this:
>>> sys.ps1 = '>>> [ready]\n'. This is not very elegant, but
helps a newbie.
It is no more possible in IDLEfork.

I wrote a python shell for Windows platforms using wxPython
as GUI. Using the wxStyledTextCtrl as editable widget, I was
able to avoid the use of the ps1/ps2 prompts, while keeping
a correct identation. This shell, called psi, is available
at http://www.chez.com/spinecho

Due to my phone connection and my poor wiki knowledge, I
never succeed to put a hyperlink to psi in the wiki editors
page. If somebody can do this for me..., thanks.

Regards
Jean-Michel Fauth, Switzerland