how to run python script from Unix Shell?

David Cinege dcinege at psychosis.com
Thu Sep 6 22:51:43 EDT 2001


On Thursday 06 September 2001 22:41, Ignacio Vazquez-Abrams wrote:
> On 6 Sep 2001, David wrote:
> > Hi there,
> >
> > Can you help to advise how to run python script from Unix Shell?
> > What I am doing is:
> > 1)chmod +x  script name
> > 2)put #!/usr/bin/python   at first line
> > 3)when I type the script name under Shell,
> > the message is:
> > bash: Script name command not found.
> >
> > Actually, it works if I type:
> > python "script name"
> >
> > But the problem is I want run it by typing "script name"
> >
> > Thanks for your help.
>
> You have to call it as follows:
>
>   ./<script name>

...or his python is not actually in /usr/bin/. Try:
$ whereis python






More information about the Python-list mailing list