[Python-Dev] PEP397 no command line options to python?

Mark Hammond skippy.hammond at gmail.com
Mon Oct 24 00:15:00 CEST 2011


On 23/10/2011 12:27 AM, Paul Moore wrote:
> (Sorry, should have gone to the list...)
>
> On 22 October 2011 13:15, Vinay Sajip<vinay_sajip at yahoo.co.uk>  wrote:
>> Nick Coghlan<ncoghlan<at>  gmail.com>  writes:
>>
>>> As a simpler alternative, I suggest the launcher just gain a "--which"
>>> long option that displays the full path to the interpreter it found.
>>>
>>> So:
>>>
>>> C:\>  py -2 --which
>>> C:\Python27\python.exe
>>>
>>> C:\>  py -3 --which
>>> C:\Python32\python.exe
>>>
>>> No significant complexity in the launcher, and if you want to add
>>> additional arguments like -m, -c, or -i you can do it by running
>>> '--which' and switching to invoking that interpreter directly.
>>
>> Perhaps even simpler would be for the -h option to print the interpreter paths
>> which would be returned for -2 and -3, on separate lines, even without the
>> --which, e.g.
>>
>> Currently configured:
>> -2: c:\Python27\python.exe
>> -3: c:\Python32\python.exe
>
> --which is nice for people who can use Unix-style $() or Powershell&
> to directly execute the output as a command.
>
> &  (py -3 --which)

How about abusing the existing flags for this purpose - eg:

% py -3?
% py -2.7?

etc.

Mark


More information about the Python-Dev mailing list