[Patches] [ python-Patches-543222 ] IDLE Shell window RunScript warning

noreply@sourceforge.net noreply@sourceforge.net
Tue, 21 May 2002 05:01:13 -0700


Patches item #543222, was opened at 2002-04-12 17:45
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=543222&group_id=5470

Category: IDLE
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Raymond Hettinger (rhettinger)
Assigned to: Guido van Rossum (gvanrossum)
Summary: IDLE Shell window RunScript warning 

Initial Comment:
Alter IDLE's ScriptBinding.py to provide a warning if 
called from the shell window instead of a program 
window.

Also, consider providing a warning for File Save or 
SaveAs from the shell window.

The purpose of the warnings is handle a newbie problem 
of typing a program in the interpreter, trying to save 
it from there with File SaveAs mymprog.py, and trying 
to run it with F5 from the shell window.

Here is an except of a dialogue on help@python.org:

[beginner]
'''I have several programs I've written and saved.  I 
have saved them as ' save ' , ' save as ' , ' save 
copy ';  but when I try to run the program I get the 
same response from the GUI, name error: name ' ' not 
defined.  The exact procedure I use is: I bring up the 
GUI; click on file; click open; click the program I 
want to run.  Then when that window opens I click 
Edit; then Run Script. When that opens I type ; 
filename ( )  to run the program and all I get is " 
filename not defined" which I'm assuming means I have 
to rewrite the entire program each time I want to use 
it.'''

[helper]
'''IDLE has an interpreted mode (indicated by the >>> 
prompt) -- that is not the place to write and save 
your program.  Select File New to create a new blank 
page for your program. Type in the program (only 
once!) and select File SaveAs myprog.py.  Next, press 
F5 which will run your program. '''

[beginner]
''' So, your saying WRITE the program on the blank 
screen , the one without the prompts, etc ? Then save 
it to file "save as" ?  I never knew that was the way 
it's to be done. I've written every program I've done 
on the idle screen.  I really appreciate your help '''






----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-05-21 08:01

Message:
Logged In: YES 
user_id=6380

Raymond, are you aware of the IDLEFORK project?
http://idlefork.sourceforge.net/
It desperately needs developers.
Maybe you can help out there?
We will gladly add you as a developer.

(I say this because the issue here is already addressed
there, in a much different way, but that won't help us until
the idle fork has been ported back...)

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2002-05-21 03:21

Message:
Logged In: YES 
user_id=80475

The attached 5 line patch disables the shell window's menu 
and key bindings for script actions.  It leaves them intact 
for other windows.

This addresses a common beginner problem (there have been 
multiple requests on the python-help maillist) without 
otherwise impacting functionality.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=543222&group_id=5470