[Idle-dev] Startup Shell Functionality

Kurt B. Kaiser kbk@shore.net
16 Jul 2001 13:23:49 -0400


Guido van Rossum <guido@digicool.com> writes:
> Hm, the 'idles' script references a package 'idlelib' so it can't be
> run from within the idle source directory.

I can't reproduce a problem; I seem to be able to import idlelib when starting
idlefork from anywhere on Linux. PyIdle has the same reference to idlelib,
isn't this handled by the __init__.py file in the directory?

(Starting from random places works as long as site-packages.pth is set up, but
that is necessary to start idlefork because of the way imp.find_modules(...)
works, it apparently doesn't handle package syntax [yet]).

> > <idle> opens an empty editor window <idle foo.py> opens an editor window
> > for foo.py <idles> opens a shell <idles -e foo.py> opens a shell and an
> > editor window for foo.py <idles foo.py> executes foo.py in shell before
> > printing prompt
> > 
> > The last behaviour is questionable, per GvR. 
> > 
> > Should it exit, or edit foo.py?
> > 
> > It may be that a better name than "idles" can be found.  I chose that
> > because it was short.  Suggestions welcomed!
> 
> I would merge it back idle.py as a separate command line option.

ok, we can always use aliases to avoid carpal tunnel ;)

> Also note that the usage message printed by idle.py now lies about -e.
> 
> My proposal:
> 
> idle -i		open a shell
> idle file	edit file
> idle -i file	open a shell and edit file
> idle -r file	run file
 
Does the -e option disappear?

When a file is run, does the output appear before the prompt like it does in
now?

Btw, there is a bug in idlefork, if you try to run a non-existing file it
barfs, the filename needs to be validated.

> Also note that the usage message printed by idle.py now lies about -e.

Yes. Will fix with the rest above.

> I would like the output window from F5 to be the shell, so that you
> can examine the globals in the shell.  (This is effectively what
> TeachScheme does.) 

That would seem to be very useful, I wonder what the gotcha is?

Regards, KBK