[Q] How to use IDLE in redhat

Steve Holden sholden at holdenweb.com
Thu Jan 10 14:19:54 EST 2002


"Cliff Wells" <logiplexsoftware at earthlink.net> wrote in message
news:mailman.1010687836.15765.python-list at python.org...
> On Thu, 10 Jan 2002 11:53:18 -0600
> Young-Jin Lee wrote:
>
> > It worked, but it is still not what I wanted.
> > After building idle, I could use idle in the
> /usr/lib/python2.2/Tools/idle
> > directory. For example, when I tried "python2 idle.py" in my home
> directory,
> > I got "python2: can't open file 'idle.py'. I think I might modify
> > $PYTHONPATH shell variable. Could anybody tell me the way to do it?
> > Thanks in advance.
>
> That's because 'python2 idle.py' searches in the path for python2, but not
> for idle.py.
> Just type 'idle' at the prompt.
>
Under Unix you'll need to

    a) Ensure the directory holding IDLE is on your path, and
    b) Use the command

            idle.py

This leads me on to a more general point: it's not as easy to use Python
programs as executables under Windows. Under Unix (and Cygwin, for that
matter) you can use Python programs pretty easily as long as they are in
your path. You can make them seem more like binaries by removing the .py
extension (since the OS uses the shebang line to identify the interpreter
anyway).

Would it be practical to modify the interpreter, at least under Windows, so
that if the "filename" argument has no extension the interpreter just tries
to import it as __main__? This would cause automatic invocation of the
PYTHONPATH, which might make it easier ofr novices to use Python. PEP?

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list