Running a python script under Linux

D'Arcy J.M. Cain darcy at druid.net
Fri Dec 14 14:38:25 CET 2012


On Fri, 14 Dec 2012 14:18:28 +0100
Hans Mulder <hansmu at xs4all.nl> wrote:
> The Pythonic way to get what you want, is to be explicit:
> 
> #!/usr/local/bin/python2.7 -V
> 
> If you do that, it will even work in situations where you
> can't control PATH, such as CGI scripts and cron jobs.

As long as you only run on one system that's OK.  That won't work on
NetBSD or Linux[1] for example.

> There are situations where using #!/usr/bin/env makes sense,
> but yours isn't one of them.

#! /usr/bin/env python2.7

[1]: Well, Ubuntu anyway.  I don't know about the others.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy at Vex.Net



More information about the Python-list mailing list