[Tutor] Linux Programs

Timothy M. Brauch tbaruch@mindless.com
Thu, 03 May 2001 23:48:33 -0400


Rick Pasotto wrote:
> 
> I think the prefered way is:
> 
> #!/usr/bin/env python
> 
> This should find the appropriate python no matter where it's located.
> 
> > This line doesn't work on my computer.  All I get is the file openned in
> > a text editor.
> 
> Huh? This doesn't make sense to me. In unix you don't get an editor
> unless you *ask* for an editor.
> 
> How are you trying to run the file?  What is your command line? Or are
> you in X and clicking on an icon?
> 
> Even without the '#!' line and regardless of the permissions (well, you
> do need 'read' permission) you can run your program by entering:
> 
> python test.py

Yeah, I realized that right after I sent this, I probably wouldn't be
able to just click on an icon in X, like I was used to in Windows.  But,
I am also having problems using command line.  Still, I can run the
program using 'python test.py' if I am in the folder 'test.py' is
stored.  I am still wondering if it is possible to just type 'test.py'
(as long as I am in the folder, or preferrably, anywhere).  I tried
using 'export PATH=$PATH: /home/tbrauch/python_files' but I get the
following error message

bash: export: `/home/tbrauch/python_files': not a valid identifier

I'm not trying to turn this into a Linux tutorial, I just hope to get
Python working on my new computer...

 - Tim