Launching a Script on the Linux Platform

Peter J. Holzer hjp-python at hjp.at
Mon Nov 18 16:15:31 EST 2019


On 2019-11-18 15:01:57 -0600, Wildman via Python-list wrote:
> On Tue, 19 Nov 2019 05:09:07 +1100, Chris Angelico wrote:
> > On Tue, Nov 19, 2019 at 5:06 AM Wildman via Python-list
> > <python-list at python.org> wrote:
> >> On Sun, 17 Nov 2019 18:27:45 +0000, Barry Scott wrote:
> >> > Because you are installing from a deb you know the exact path to the python you
> >> > need to use. There is no need to use the /usr/bin/env to search the path and
> >> > potential break your code, because a version of python that you do not expect is on
> >> > the path.
> >>
> >> I don't understand.  The deb does not install python so I
> >> fail to see how I would know the exact path.
> >>
> >> As to env breaking my code, never heard of such a thing.
> >>
> > 
> > The deb should depend on an appropriate Python package. Then you can
> > assume and expect that this version of Python is installed.
> 
> Yes, of course, python(3) is listed as a "depends" in the deb
> control file.  That does insure that python is installed but
> in no way does that tell me the path of the python executable.

The debian packaging guidelines tell you where the execuable has to be.
If you install the python package you can be very sure that the
executable will be in /usr/bin. And this is the executable you want to
use. You don't want to use some other random program called "python"
(which may or may not be an interpreter for some version of the Python
language) which just happens to be in the user's path.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20191118/46f31b89/attachment.sig>


More information about the Python-list mailing list