[Tutor] Issues In Terminal

Steven D'Aprano steve at pearwood.info
Mon Sep 27 01:01:16 CEST 2010


On Mon, 27 Sep 2010 08:37:08 am Bill DeBroglie wrote:
> > No, I meant that you should edit your .py file and add
> > #!/usr/bin/env python
> > as the first line, THEN try to run it.
>
> BINGO!
>
> > Right now what's happening is that you're handing a line of Python
> >   script to the shell and asking it to run it; the shell is telling
> > you (oh-so-politely) "what the hell is this?"  You need to give it
> > a clue.
>
> Thank you for the translation. So I need to do this with every .py  
> file?

Only if you want to run them without specifying Python on the command 
line.


You can always call python first:

python name-of-my-script.py


instead of just 

name-of-my-script.py



-- 
Steven D'Aprano


More information about the Tutor mailing list