[Linux-SIG] Introducing a Python launcher for *nix?

Barry Warsaw barry at python.org
Wed Oct 7 18:23:04 CEST 2015


[Reposting for the Gmane newsgroup]
[Quoting out of order]

>P.S. This list may not have enough subscribers yet to have a good
>discussion, so I'll post another thread about advertising, and then we
>can reboot this thread later if needed.

Agreed.

On Oct 07, 2015, at 01:28 PM, Nick Coghlan wrote:

>What do folks think of the idea of introducing a "Python Launcher for
>*nix" using the following iterative development model:
>
>1. We update the Python 3 *nix builds to provide a "py" symlink by
>default. This would be the baseline state for Python 3.6 if the next
>step isn't completed in time.
>
>2. The symlink is replaced with a custom launcher that works like the
>Python 3.5 version of the Windows launcher:
>
>* accepts "-3", "-2", etc command line arguments like the Windows launcher
>* checks for an active virtualenv, if it finds one, uses the venv's
>default Python
>* checks for a user specific config file
>* checks for a global config file

I like it, although I would also like to support major.minor specifications.
For example, in Ubuntu 15.10 we'll have two supported Python 3 versions, 3.4
and 3.5.  We do have /usr/bin/python3 pointing to the default version,
i.e. /usr/bin/python3.4 and that changes as we roll over to the new default
version (it'll be 3.5 only for the next LTS).

So `py -3` is unambiguous but folks might want to use `py -3.4` which kind of
looks ugly.  Maybe the launcher should take an optional mutually exclusive
argument such as -i/--interpreter which would either give a shorthand, like
3.4 or a full path to the interpreter to choose.  That would let people
install say 3.6 in /usr/local and then they could
`py -i /usr/local/bin/python3.6`

(Is that a win over just using /usr/local/bin/python3.6?  Not really, but I
can see the launcher being scriptable so you'd want to allow such scripts to
substitute the exact interpreter they want to use.  OTOH YAGNI.)

Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/linux-sig/attachments/20151007/20c0b091/attachment.sig>


More information about the Linux-sig mailing list