[Tutor] python scripting using "./"

Hank Wilkinson hwilkinson at triad.rr.com
Tue May 24 16:15:18 CEST 2011


Yes, I would love to know why it doesn't work, or what I'm doing wrong.

John-Wilkinsons-iMac:p31summerfield wilkinson$ cat hello.py
#!/usr/bin/env python

print("Hello world")
John-Wilkinsons-iMac:p31summerfield wilkinson$ chmod +X hello.py
John-Wilkinsons-iMac:p31summerfield wilkinson$ ./hello.py
-bash: ./hello.py: Permission denied
John-Wilkinsons-iMac:p31summerfield wilkinson$ 

On May 24, 2011, at 10:02 AM, Walter Prins wrote:

> 
> 
> On 24 May 2011 14:51, Hank Wilkinson <hwilkinson at triad.rr.com> wrote:
> Thank you, I changed the first line to:
> #!/usr/bin/env/python3
> then I tried again:
> John-Wilkinsons-iMac:p31summerfield wilkinson$ ./hello.py
> -bash: ./hello.py: /usr/bin/env/python3^M: bad interpreter: Not a directory
> John-Wilkinsons-iMac:p31summerfield wilkinson$
> 
> So I am getting different messages, but ...
> 
> Yes, the exact line to use is:
> 
> #!/usr/bin/env python
> 
> Note the space between "/usr/bin/env" and  "python".
> 
> If you'd like to know what's happening here I'll explain.
> 
> Walter
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110524/d6e77089/attachment.html>


More information about the Tutor mailing list