[Python-Dev] PEP 397 and idle

Terry Reedy tjreedy at udel.edu
Tue Nov 1 22:28:54 CET 2011


On 11/1/2011 2:20 PM, David Bailey wrote:

> population of windows users of python, make idle easier to use or fix
> print in 3.X or both.

print is fixed in 3.x. This is not the place to argue otherwise. If you 
want to rant againt print as function, go to python-list.

If one looks up 'print' in the index, it is clearly and immediately 
identified as a "built-in function" (at least in Window help version of 
docs).

IDLE is as trivial to use as anything. A Start menu icon is installed. 
If used often, it appears in the frequently used programs list. I 
presume a shortcut can be copied to the desktop. I just have it pinned 
to my taskbar. One click and it starts. Could not be easier.

Now, it would be better if the icons were labelled by version. I thought 
that had been agreed on, and I intend to request it again.

> is that very few python-dev developers use windows.  I wouldn't.

I am an exception; I have used it for a decade and still do.
And I still plan to work on improving it.

> fascinating to watch a new python user on windows. The typical scenario
> is that they download both a version of 3.X and 2.6 or 2.7 because they
> are not sure which is correct. I tell them to uninstall 3.X

WRONG, WRONG, WRONG. New users should install the most recent 3.x, learn 
it, and only bother with 2.7 if they actually NEED it.

 > but there is a lot of push back because they don't want the "old stuff".

They are correct about that. 3.x is easier to learn because of the 
removal of obsolete junk.

> microsoft word to write a python 'hello world'.

That works if, AND ONLY IF, they know to save as plain vanilla text 
mode. Perhaps this needs to be emphasized better. Notepad works better. 
IDLE is much, much better yet.

> Every book they read says type print "hello world" into hello.py.

Only old 2.x books. Any 3.x book (like Mark Summerfield's) will say 
'print("Hello world")'

Do the people you are talking about expect that everything in a Windows 
XP book applies without change to Windows 7?

 > They will try any way they know how.

Except look in the doc, with its index? Or type 'help(print)'?
Any decent beginner book or class should explain how to use both the 
docs and help(). I hope our tutorial does.

> Then they double click on hello.py

This and PEP 397 have nothing to do with IDLE. It is for interactive use 
and editing.

It would be helpful if the right-click context menu for .py files had an 
'Edit with IDLEx.y' for each version installed, instead of one 'Edit 
with IDLE'. But there is no 'correct' version for editing. It depends on 
what the user intends to do, and what version the user wants the file to 
run with *after* editing.

IDLE could be enhanced to look at the first line of files that it is 
opening and if there is a conflicting shebang line, ask if the use wants 
to open it with a different version of Python and IDLE. This should NOT, 
however, be automatic as the user might want to edit the file (including 
the first line) to work with the Python version already running.

> #!/usr/bin/env python3
> print ("hello world")
> input('>')
>
> It now executes correctly when they double click and the command window
> stays open. Python works and everyone is happy, but idle is broken and
> continues to generate a syntax error.

IDLE 3.2 runs the above fine. I have no idea what you are talking about.

> It is truly unfortunate that print breaks between versions of python.
> The uninitiated do not expect that.

So they should start with 3.2 and never learn about the old version 
unless they really, really have to.

> " ok now lets first create .bat files to start different versions of
> idle,

Why? The installers already create version-specific icons (which, as I 
said, should be better labelled), and beginners should start with the 
modern one.

 > their eyes start to glaze over.

No wonder.

> An then when I say " OK now lets
> put copies of these .bat files in all the python folders on the desktop"

Why? This make no sense to me, an experience IDLE user.

> they start looking out the real windows.

No wonder.

> What once took 5 min in a
> training now takes the whole hour if someone has loaded two versions,

So they should not do that, and you should not mess their heads with 
talk about unneeded .bat files.

> Idle needs to be smart so it runs the correct version of python,

IDLE does not run Python, it is run by Python, and the Python it is run 
by runs *its* version of IDLE in *its* stdlib.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list