On 28/09/12 12:57, Roy Smith wrote:
But, you might as well get into the habit of
using the /usr/bin/env flavor because it's more flexible.
In the same manner as one's freedom-fighter is another's fundamentalist
terrorist, what's flexible could be also dangerous. E.g.,
#!/usr/bin/env python
Hello
I've seen both shebang lines to run a Python script on a *nix host:
#!/usr/bin/env python
#!/usr/bin/python
What's the difference?
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Gilles writes:
#!/usr/bin/env python
#!/usr/bin/python
What's the difference?
Not much if your python is /usr/bin/python: env looks for python and
finds the same executable.
When python is not /usr/bin/python but something else that is still
found by your system, /usr/bin/env still finds
In article 34va6856ocuas7jpueujscf3kdt7k44...@4ax.com,
Gilles nos...@nospam.com wrote:
Hello
I've seen both shebang lines to run a Python script on a *nix host:
#!/usr/bin/env python
#!/usr/bin/python
What's the difference?
The first one looks through your PATH to find the right
On Fri, 28 Sep 2012 06:57:28 -0400, Roy Smith r...@panix.com wrote:
The first one looks through your PATH to find the right python
interpreter to run. The second one is hard-wired to run /usr/bin/python.
If you only have a single copy of python installed, it doesn't really
matter which you
On Fri, 28 Sep 2012 06:57:28 -0400
Roy Smith r...@panix.com wrote:
I've seen both shebang lines to run a Python script on a *nix host:
#!/usr/bin/env python
#!/usr/bin/python
What's the difference?
The first one looks through your PATH to find the right python
interpreter to
On Fri, 28 Sep 2012 09:19:54 -0400, D'Arcy Cain da...@druid.net
wrote:
Not just flexible but portable. On various systems I have Python
in /usr/bin, /usr/local/bin and /usr/pkg/bin. #!/usr/bin/env python
finds it in each case so I only need one version of the script.
Good to know.
--
On 12-09-28 06:19 AM, D'Arcy Cain wrote:
Not just flexible but portable. On various systems I have Python
in /usr/bin, /usr/local/bin and /usr/pkg/bin. #!/usr/bin/env python
finds it in each case so I only need one version of the script.
+1. This also resolves correctly on Cygwin, even if
Brian Vanderburg II [EMAIL PROTECTED] wrote:
D'Arcy J.M. Cain wrote:
Brian Vanderburg II [EMAIL PROTECTED] wrote:
This is sort of related, but I'm wondering what is different between
#!/usr/bin/env python and #!python. Wouldn't the second do the same
thing, since an absolute path is not
This is sort of related, but I'm wondering what is different between
#!/usr/bin/env python and #!python. Wouldn't the second do the same
thing, since an absolute path is not specified, find 'python' from the
PATH environment, I don't really know.
Brian Vanderburg II
--
For me, the difference is #!python doesn't work for me. I get a bad
interpreter error.
On Thu, May 8, 2008 at 6:31 AM, Brian Vanderburg II
[EMAIL PROTECTED] wrote:
This is sort of related, but I'm wondering what is different between
#!/usr/bin/env python and #!python. Wouldn't the second do
On Thu, 08 May 2008 07:31:17 -0400
Brian Vanderburg II [EMAIL PROTECTED] wrote:
This is sort of related, but I'm wondering what is different between
#!/usr/bin/env python and #!python. Wouldn't the second do the same
thing, since an absolute path is not specified, find 'python' from the
D'Arcy J.M. Cain wrote:
On Thu, 08 May 2008 07:31:17 -0400
Brian Vanderburg II [EMAIL PROTECTED] wrote:
This is sort of related, but I'm wondering what is different between
#!/usr/bin/env python and #!python. Wouldn't the second do the same
thing, since an absolute path is not specified,
On 5/6/08, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
At our site we run IRIX, UNICOS, Solaris, Tru64, Linux, cygwin and
other unixy OSes.
We have python installed in a number of different places:
/bin/python
/usr/local/bin/python
/usr/bin/python
2008/5/6, Banibrata Dutta [EMAIL PROTECTED]:
Use /usr/bin/env. If env is not in /usr/bin, put a link to it there.
So why not put symlink to Python over there on all machines, if we can
put one (or env itself) there ?
To avoid linking all the rest of interpreters like perl, ruby, lua and
Wojciech Walczak [EMAIL PROTECTED] writes:
2008/5/6, Banibrata Dutta [EMAIL PROTECTED]:
Use /usr/bin/env. If env is not in /usr/bin, put a link to it there.
So why not put symlink to Python over there on all machines, if
we can put one (or env itself) there ?
To avoid linking all
2008/5/6, Ben Finney [EMAIL PROTECTED]:
So why not put symlink to Python over there on all machines, if
we can put one (or env itself) there ?
To avoid linking all the rest of interpreters like perl, ruby, lua
and dozens of others.
The argument was being made from thousands of
Banibrata Dutta wrote:
On 5/6/08, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
At our site we run IRIX, UNICOS, Solaris, Tru64, Linux, cygwin and
other unixy OSes.
We have python installed in a number of different places:
/bin/python
/usr/local/bin/python
/usr/bin/python
On May 6, 9:06 pm, Ben Finney [EMAIL PROTECTED]
wrote:
Wojciech Walczak [EMAIL PROTECTED] writes:
2008/5/6, Banibrata Dutta [EMAIL PROTECTED]:
Use /usr/bin/env. If env is not in /usr/bin, put a link to it there.
So why not put symlink to Python over there on all machines, if
we
At our site we run IRIX, UNICOS, Solaris, Tru64, Linux, cygwin and
other unixy OSes.
We have python installed in a number of different places:
/bin/python
/usr/local/bin/python
/usr/bin/python
/opt/freeware/Python/Python-2.5.1/bin/python
~mataap/platform/python/python-2.5.1
So I cannot assume a
Ben Finney [EMAIL PROTECTED] writes:
The shebang line (the initial line of the file beginning with #!)
takes advantage of OS kernels that determine how to execute a file
based on the first few bytes of the file. The shebang line tells the
kernel that this file should be executed by passing it
Hallöchen!
Gabriel Genellina writes:
[...]
I can't believe some angry responses in this thread - it's just a
technical question, not about which is the best team in the
[preferred sports here] National Championship...
Well, Python-list is tunnelled to Usenet. Welcome here. ;-)
Tschö,
In article [EMAIL PROTECTED],
Grant Edwards [EMAIL PROTECTED] wrote:
On 2008-05-02, D'Arcy J.M. Cain [EMAIL PROTECTED] wrote:
On Sat, 03 May 2008 00:44:00 +1000
Ben Finney [EMAIL PROTECTED] wrote:
D'Arcy J.M. Cain [EMAIL PROTECTED] writes:
As someone else pointed out, not all the world
I work on an AIX system where /usr/bin and /usr/local/bin apps can only be
installed by root. Our system doesn't have python or many other tools we
like to use installed so we have to install python in an alternate directory
location. We have a system installation of Perl installed, but it's a
In article [EMAIL PROTECTED],
Gabriel Genellina [EMAIL PROTECTED] wrote:
I can't believe some angry responses in this thread - it's just a
technical question, not about which is the best team in the [preferred
sports here] National Championship...
-On [20080502 07:51], Ben Finney ([EMAIL PROTECTED]) wrote:
To my mind, the Python interpreter installed by a package as
distributed with the OS *is* OS territory and belongs in /usr/bin/.
That's the difference with a distribution, such as Linux, and full OSes ,
such as BSDs or commercial Unix
Yves Dorfsman [EMAIL PROTECTED] wrote:
On UNIX, some people use
#!/usr/bin/env python
While other use
#!/usr/bin/python
Why is one preferred over the other one ?
I don't think the answers so far have communicated what I believe to be the
important point: it isn't that one is always
Jeroen Ruigrok van der Werven [EMAIL PROTECTED] writes:
-On [20080502 07:51], Ben Finney ([EMAIL PROTECTED]) wrote:
To my mind, the Python interpreter installed by a package as
distributed with the OS *is* OS territory and belongs in /usr/bin/.
That's the difference with a distribution,
On Fri, 02 May 2008 15:50:22 +1000
Ben Finney [EMAIL PROTECTED] wrote:
You have lived a sheltered life. Not every packaging system puts the
executible in /usr/bin. Many systems use /usr/local/bin.
They use that for the operating-system-installed default Python
interpreter? Colour me
D'Arcy J.M. Cain [EMAIL PROTECTED] writes:
On Fri, 02 May 2008 13:24:01 +1000
Ben Finney [EMAIL PROTECTED] wrote:
I much prefer #! /usr/bin/python because I want my Python
programs to, by default, be run with the default Python, and
depend on Python being installed by the operating
* Ben Finney (Fri, 02 May 2008 23:30:01 +1000)
The OP was asking why people prefer on over the other. My answer is
that I prefer specifying give me the default OS Python because
anything not installed by the OS is to non-standardised for me to
worry about.
Others may prefer something
In article [EMAIL PROTECTED],
Ben Finney [EMAIL PROTECTED] wrote:
Whereas if Python is *not* installed from an OS package, it's up to
the sys admin to ensure that it works -- not up to my program. So I
don't see the point in making it work by default, when what I want for
my program is that
On Fri, 02 May 2008 23:30:01 +1000
Ben Finney [EMAIL PROTECTED] wrote:
The OP was asking why people prefer on over the other. My answer is
that I prefer specifying give me the default OS Python because
anything not installed by the OS is to non-standardised for me to
worry about.
As someone
Hallöchen!
D'Arcy J.M. Cain writes:
On Fri, 02 May 2008 23:30:01 +1000
Ben Finney [EMAIL PROTECTED] wrote:
The OP was asking why people prefer on over the other. My answer
is that I prefer specifying give me the default OS Python
because anything not installed by the OS is to
Thorsten Kampe [EMAIL PROTECTED] writes:
* Ben Finney (Fri, 02 May 2008 23:30:01 +1000)
The OP was asking why people prefer on over the other. My answer
is that I prefer specifying give me the default OS Python
because anything not installed by the OS is to non-standardised
for me to
On 2008-05-02, Ben Finney [EMAIL PROTECTED] wrote:
The specified command takes the form of a fully-qualified file
path, and zero or one arguments to the program. That command
is then executed by the kernel, and the Python program file is
passed as input to the resulting process.
Just to
Roy Smith [EMAIL PROTECTED] writes:
In article [EMAIL PROTECTED],
Ben Finney [EMAIL PROTECTED] wrote:
Whereas if Python is *not* installed from an OS package, it's up
to the sys admin to ensure that it works -- not up to my program.
So I don't see the point in making it work by
D'Arcy J.M. Cain [EMAIL PROTECTED] writes:
On Fri, 02 May 2008 23:30:01 +1000
Ben Finney [EMAIL PROTECTED] wrote:
The OP was asking why people prefer on over the other. My answer
is that I prefer specifying give me the default OS Python
because anything not installed by the OS is [too]
On 2008-05-02, Jeroen Ruigrok van der Werven [EMAIL PROTECTED] wrote:
I've never clearly understood why people want to use #! /usr/bin/env
python, which is prone to finding a different Python from the one
installed by the operating system. I'd be interested to see what
responses are in favour of
On 2008-05-02, Jeroen Ruigrok van der Werven [EMAIL PROTECTED] wrote:
-On [20080502 07:51], Ben Finney ([EMAIL PROTECTED]) wrote:
To my mind, the Python interpreter installed by a package as
distributed with the OS *is* OS territory and belongs in /usr/bin/.
That's the difference with a
On Fri, 02 May 2008 16:26:51 +0200
Torsten Bronger [EMAIL PROTECTED] wrote:
Certainly #! /usr/bin/python is fine if you never expect your
software to run outside of your own little corner of the world but
you asked why people prefer the env version and the answer is that
we want to write
Hallöchen!
D'Arcy J.M. Cain writes:
On Fri, 02 May 2008 16:26:51 +0200
Torsten Bronger [EMAIL PROTECTED] wrote:
Certainly #! /usr/bin/python is fine if you never expect your
software to run outside of your own little corner of the world
but you asked why people prefer the env version and
On Sat, 03 May 2008 00:44:00 +1000
Ben Finney [EMAIL PROTECTED] wrote:
D'Arcy J.M. Cain [EMAIL PROTECTED] writes:
As someone else pointed out, not all the world is Linux.
It's a good thing I've never implied such to be the case.
You haven't *said* it but you have definitely *implied* it.
On Sat, 03 May 2008 00:43:02 +1000
Ben Finney [EMAIL PROTECTED] wrote:
Roy Smith [EMAIL PROTECTED] writes:
Have you ever shipped software to a customer?
Yes, and all parties have been quite happy with the results.
When some of us talk about shipping software we aren't talking about a
20
On 2008-05-02, D'Arcy J.M. Cain [EMAIL PROTECTED] wrote:
On Sat, 03 May 2008 00:44:00 +1000
Ben Finney [EMAIL PROTECTED] wrote:
D'Arcy J.M. Cain [EMAIL PROTECTED] writes:
As someone else pointed out, not all the world is Linux.
It's a good thing I've never implied such to be the case.
Thanks everybody, I didn't mean to start a flamewar...
I do get it now, it's whatever python is in the path, vs. the specific one
you're pointing to.
Ben Finney wrote:
No, because it's quite common for the PATH variable to have
'/usr/local/bin' appear *before* both of '/bin' and '/usr/bin'.
* Ben Finney (Sat, 03 May 2008 00:37:45 +1000)
Thorsten Kampe [EMAIL PROTECTED] writes:
* Ben Finney (Fri, 02 May 2008 23:30:01 +1000)
The OP was asking why people prefer on over the other. My answer
is that I prefer specifying give me the default OS Python
because anything not
On May 2, 11:07 am, D'Arcy J.M. Cain [EMAIL PROTECTED] wrote:
On Sat, 03 May 2008 00:43:02 +1000
Ben Finney [EMAIL PROTECTED] wrote:
Roy Smith [EMAIL PROTECTED] writes:
Have you ever shipped software to a customer?
Yes, and all parties have been quite happy with the results.
When some
Ben Finney wrote:
No, because it's quite common for the PATH variable to have
'/usr/local/bin' appear *before* both of '/bin' and '/usr/bin'.
If the system has a sysadmin-installed '/usr/local/bin/python'
installed as well as the OS-installed '/usr/bin/python', then the two
shebang options the
Yves Dorfsman wrote:
On UNIX, some people use
#!/usr/bin/env python
While other use
#!/usr/bin/python
Why is one preferred over the other one ?
Caveat: I've only read *most* of this thread, so maybe someone else has already
made the following point.
It depends on the context. Ultimately,
D'Arcy J.M. Cain [EMAIL PROTECTED] writes:
On Sat, 03 May 2008 00:43:02 +1000
Ben Finney [EMAIL PROTECTED] wrote:
Roy Smith [EMAIL PROTECTED] writes:
Have you ever shipped software to a customer?
Yes, and all parties have been quite happy with the results.
When some of us talk
En Fri, 02 May 2008 12:07:55 -0300, D'Arcy J.M. Cain [EMAIL PROTECTED]
escribió:
On Sat, 03 May 2008 00:43:02 +1000
Ben Finney [EMAIL PROTECTED] wrote:
Roy Smith [EMAIL PROTECTED] writes:
Have you ever shipped software to a customer?
Yes, and all parties have been quite happy with the
On UNIX, some people use
#!/usr/bin/env python
While other use
#!/usr/bin/python
Why is one preferred over the other one ?
Thanks.
--
Yves.
http://www.SollerS.ca
--
http://mail.python.org/mailman/listinfo/python-list
The first method allows python to be installed in an alternate location
(i.e. /usr/local/bin). env in this case is being used to launch python
from whatever location python is installed to.
I like to think of it as an abstraction of the python location to make it
multiplatform-friendly since not
Yves Dorfsman [EMAIL PROTECTED] writes:
On UNIX, some people use
#!/usr/bin/env python
While other use
#!/usr/bin/python
You haven't indicated your understanding of what the difference in
meaning is, so I'll explain it for those who might not know.
The shebang line (the initial line of
In article [EMAIL PROTECTED],
Ben Finney [EMAIL PROTECTED] wrote:
I've never clearly understood why people want to use #! /usr/bin/env
python, which is prone to finding a different Python from the one
installed by the operating system. I'd be interested to see what
responses are in favour of
On Fri, 02 May 2008 13:24:01 +1000
Ben Finney [EMAIL PROTECTED] wrote:
I much prefer #! /usr/bin/python because I want my Python programs
to, by default, be run with the default Python, and depend on Python
being installed by the operating system's package manager. On systems
that use shebang
-On [20080502 05:26], Ben Finney ([EMAIL PROTECTED]) wrote:
I've never clearly understood why people want to use #! /usr/bin/env
python, which is prone to finding a different Python from the one
installed by the operating system. I'd be interested to see what
responses are in favour of it, and
Yves Dorfsman [EMAIL PROTECTED] wrote:
On UNIX, some people use
#!/usr/bin/env python
While other use
#!/usr/bin/python
Why is one preferred over the other one ?
The /usr/bin/env solution finds the Python interpreter anywhere on the
PATH, whether it be /usr/bin or /usr/local/bin, or whatever.
Jeroen Ruigrok van der Werven [EMAIL PROTECTED] writes:
-On [20080502 05:26], Ben Finney ([EMAIL PROTECTED]) wrote:
I've never clearly understood why people want to use #!
/usr/bin/env python, which is prone to finding a different Python
from the one installed by the operating system. I'd be
D'Arcy J.M. Cain [EMAIL PROTECTED] writes:
On Fri, 02 May 2008 13:24:01 +1000
Ben Finney [EMAIL PROTECTED] wrote:
I much prefer #! /usr/bin/python because I want my Python
programs to, by default, be run with the default Python, and
depend on Python being installed by the operating
61 matches
Mail list logo