[Tutor] Help with Python on Red Hat 8

Rob McGee tutor@python.org
Sat Jul 26 18:11:01 2003


On Sat, Jul 26, 2003 at 10:23:54PM +0100, Paul Hickey wrote:
> I Just loaded RH8 on to a laptop and went to use Python, its not
> listed anywhere in the GUI, I found it by opening the Terminal.

python itself is not a GUI program; it is a character-based interpreter.

> In terminal I typed Python, and now Python is running.

That's "python", BTW: Unix-like OS's are case-sensitive.

> However its at the >>>_ prompt, so my question is how do I open a file
> to write a program, and save it as I did in Windows.

This can be done in any editor. Many of them do syntax highlighting and
colour for python and other languages. Put this:
    #!/usr/bin/env python
as the first line of yourScript.py (the ".py" is optional), and make it
executable:
    chmod +x yourScript.py
You can then run that script from the command line by name (but you'll
need a path, either relative or absolute, if it's not in your shell's
search path -- $PATH in bash.)

KDE can set up command shortcuts similar to what Windows does. You can
also use KDE's interface to make a file executable. KDE can hide many
details from the user, just as Windows does ... which can be either /
both good and bad (depending on the user and his/her needs.)

You might want an IDE. You probably have IDLE installed. You can do
"locate idle.py" (after the locate database has been created, which is
probably done automatically at night) to find it. It may be set up as an
icon in your GUI -- I don't know. (Note that KDE, the most common GUI
choice these days, is by no means the only one. There is far more choice
and variation among X11 window managers and desktop environments than
there is in Windows, and most of them are completely customisable.

KDevelop also supports python. You say you have Red Hat 8.0, but the
GUI's of the free software world move very quickly, so that's behind the
times already. Perhaps you'll want to consider more recent releases. The
older ones work just fine, of course, but the thing is, a few years ago
most of these GUI projects were considerably behind Windows in terms of
functionality and ease of use. I'm not sure that's still the case.[1]

Welcome to GNU/Linux, HTH.

    Rob - /dev/rob0


[1] I never intend to find out, either. :) Having already made the
    switch long ago, there's no need to go back. KDE 3.1.2 beats any
    Windows I ever used (3.1, 95, NT4). Much of what I do is command-
    line work anyway, so I'm not interested in a sales pitch for XP. :)