While this thread has focused on the location and means of managing py.ini,
I think there is a more general solution that should be considered to the
original problem, as described.  The problem isn't that it's difficult or
non-obvious how to set the default python for the py.exe launcher (that's a
possible documentation issue, and I argue a minor tooling problem), the
problem is that the launcher, by default, selects the latest version of
python as the default, regardless of that python's release status.  Without
looking at the C code (I haven't but should), I don't think it would be too
difficult to teach py.exe to not auto-select dev, alpha, or beta versions of
python without being told explicitly to do so.

For example (for the archives, this is written in February 2018, when 3.7 is
in its beta), on a system with 3.6 and 3.7 installed...

   py.exe myfile.py  REM should run 3.6, unless shebang overrides
   py.exe -3.7 myfile.py REM should run 3.7 beta

And after 3.7.0 final is released and installed on said system, py.exe
myfile.py should run 3.7.

Is this difficult to implement?  Is this a bad idea?

> -----Original Message-----
> From: Python-ideas [mailto:python-ideas-bounces+tritium-
> list=sdamon....@python.org] On Behalf Of Steve Barnes
> Sent: Monday, February 5, 2018 3:11 AM
> To: Python-Ideas <python-ideas@python.org>
> Subject: [Python-ideas] Possible Enhancement to py Launcher - set default
> 
> When a new version of python is in alpha/beta it is often desirable to
> have it installed for tests but remain on a previous version for day to
> day use.
> 
> However, currently the Windows py launcher defaults to the highest
> version that it finds, which means that unless you are very careful you
> will end up having to explicitly specify your older version every time
> that you start python with it once you have installed the newer version.
> 
> I an thinking that it would be relatively simple to expand the current
> launcher functionality to allow the user to set the default version to
> be used.
> 
> One possible syntax, echoing the way that versions are displayed with
> the -0 option would be to allow py -n.m* to set and store, either in the
> registry, environment variable or a configuration file, the desired
> default to be invoked by py or pyw.
> 
> Personally I thing that this would encourage more people to undertake
> testing of new candidate releases of python.
> 
> I would be interested in any feedback on the value that this might add.
> 
> --
> Steve (Gadget) Barnes
> Any opinions in this message are my personal opinions and do not reflect
> those of my employer.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to