[Tutor] Linux Programs

Timothy M. Brauch tbaruch@mindless.com
Thu, 03 May 2001 21:45:34 -0400


Okay, I'm slowly making a move from Windows to (Red Hat 7.0) Linux, but
there are somethings in Linux that I just can't figure out how to do. 
One of these things is using Python.

I can open the Python interpreter (by typing 'python' in the terminal
window).  I can even open Idle when I am running xWindows (I just type
'idle' in the terminal).  And, I can write and run programs in Idle.

But, the problem comes after that.  I can't get my programs to run
outside of Idle.  I know I have to add a line at the beginning of each
python file, but I don't know what that line is.  When I wrote Python
files for a class on the (Mandrake) Linux machines, the line was:

#!/usr/bin/python

This line doesn't work on my computer.  All I get is the file openned in
a text editor.  I have Python installed in /usr/lib/python1.5/ because
that is where it was installed when I installed Linux.  /usr/bin/python
and /usr/bin/python1.5 both exist, but putting '#!/usr/bin/python' or
'#!/usr/bin/python1.5' still opens the files in a text editor, even if I
saved the file as 'test.py'

Can anyone help me?  I need to be able to write Python programs so I can
start my assignment of creating the Processor Simulator.

 - Tim