[Tutor] Linux Programs

Daniel Coughlin kauphlyn@speakeasy.org
Thu, 3 May 2001 19:22:39 -0700 (PDT)


I am guessing you have permissions set up correctly, but if not
type in
man chmod
at the command prompt to figure out how to get the permissions set correctly.

secondly and most likely the directory youre running test.py out of probably
isnt
in your path.
you can check this by typing
echo $PATH
at the command prompt
to add the directory to your path you can type
export PATH=$PATH: /home/myuserdirecory/mypython
or whatever your directory is.
you should also be able to run your python program by typing
./test.py
at the command prompt even if you dont change your path.

hope this helps

Daniel

On Thu, 3 May 2001, Timothy M. Brauch wrote:

> 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
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>