Possible Enhancement to py.exe Python Launcher

Following on from the discussions on pip I would like to suggest, (and possibly implement), a minor change to the current py.exe python launcher. Currently the launcher, when called without a version specifier, defaults to the highest version on the basis of 3>2, x.11 > x.9, -64 > -32 however this may not always be the most desirable behaviour. I would like to suggest that it take a configuration value for the default version to use, (and possibly a separate ones for pyw, & file associations), honouring the following with the later overriding: default - as current system setting - from registry user setting - from registry user setting - from config file maybe %appdata%\pylauncher\defaults.ini environment setting - from getenv local setting - from .pyconfig file in the current directory. Options would be the same format as the -X[.Y][-BB] format currently accepted on the command line plus a --No-Py-Default option which would always error out if the version to invoke was not specified. I see this as potentially adding quite a lot of value for people with multiple python versions installed and it could tie in quite well with the possible use of py.exe as an entry point for tools such as pip. It might also increase the awareness of the launcher as those who have to stick with python 2 for the moment or in a specific context could set the default to what they need but can always override. -- Steve (Gadget) Barnes Any opinions in this message are my personal opinions and do not reflect those of my employer. --- This email has been checked for viruses by AVG. http://www.avg.com

If I understand your proposal correctly, this is already possible, see https://www.python.org/dev/peps/pep-0397/#python-version-qualifiers The details are likely a little different than what you're proposing, but if they don't cover what you're trying to do, maybe you could give a more specific example of a use case that isn't currently possible? Paul On 23 November 2017 at 08:43, Steve Barnes <gadgetsteve@live.co.uk> wrote:

Thanks Paul, I had missed that section of PEP-0397 - the only options that are not covered are loading a local configuration from the current directory and the option to set a prompt/error if the python version is not specified on the command line or in the shebang. Sorry for the noise! Steve On 23/11/2017 09:53, Paul Moore wrote:
-- Steve (Gadget) Barnes Any opinions in this message are my personal opinions and do not reflect those of my employer. --- This email has been checked for viruses by AVG. http://www.avg.com

If I understand your proposal correctly, this is already possible, see https://www.python.org/dev/peps/pep-0397/#python-version-qualifiers The details are likely a little different than what you're proposing, but if they don't cover what you're trying to do, maybe you could give a more specific example of a use case that isn't currently possible? Paul On 23 November 2017 at 08:43, Steve Barnes <gadgetsteve@live.co.uk> wrote:

Thanks Paul, I had missed that section of PEP-0397 - the only options that are not covered are loading a local configuration from the current directory and the option to set a prompt/error if the python version is not specified on the command line or in the shebang. Sorry for the noise! Steve On 23/11/2017 09:53, Paul Moore wrote:
-- Steve (Gadget) Barnes Any opinions in this message are my personal opinions and do not reflect those of my employer. --- This email has been checked for viruses by AVG. http://www.avg.com
participants (2)
-
Paul Moore
-
Steve Barnes