[LWN Logo]

From: Guido van Rossum <guido@CNRI.Reston.VA.US>
Subject: Re: IDLE 0.2 -- Integrated DeveLopment Environment for Python
Date: Sat, 9 Jan 1999 05:28:16 GMT

(Replying to my own post here)

> > Or is there some way to start an interperter on my current
> > file, that I have been too blind to find yet?
> 
> I'm working on it.  Some unfinished work is in ScriptBinding.py.
> Expect this for 0.3!

A new ScriptBinding.py is now ready.  Pick it up from

    ftp://ftp.python.org/pub/python/src/ScriptBinding.py

drop in your idle 0.2 directory, add "ScriptBinding" to the list in
extend.py, and voila -- at the bottom of the Edit menu you'll find
two new commands, "Run module" and "Debug module".  (I know, there
should be a separate menu for these and similar commands.  Later!)

Here's the doc string:

"""Extension to execute code outside the Python shell window.

This adds two commands (to the Edit menu, until there's a separate
Python menu):

- Run module (F5) is equivalent to either import or reload of the
current module.  The window must have been saved previously. The
module only gets added to sys.modules, it doesn't get added to
anyone's namespace; you can import it in the shell if you need to.  If
this generates any output to sys.stdout or sys.stderr, a new output
window is created to display that output. The two streams are
distinguished by their text color.

- Debug module (Control-F5) does the same but executes the module's
code in the debugger.

When an unhandled exception occurs in Run module, the stack viewer is
popped up.  This is not done in Debug module, because you've already
had an opportunity to view the stack.  In either case, the variables
sys.last_type, sys.last_value, sys.last_traceback are set to the
exception info.

"""

--Guido van Rossum (home page: http://www.python.org/~guido/)