Thread: Python on unix
View Single Post
Old Feb 9th, 2008, 7:43 PM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 837
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Python on unix

Is there a way to get a Python script to run from the command line in Unix without the "python" prefix? For example, instead of typing python myscript.py, typing myscript.py (with or without the ./)?

I know that Perl scripts can be run by simply typing the script name (assuming you are in the enclosing directory).

I tried adding a shebang line to my Python script no avail.

EDIT: I figured it out. I had to chmod the script to 777.
titaniumdecoy is offline   Reply With Quote