[Python-ideas] pep 397

Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de
Thu Jan 15 15:58:28 CET 2015


On 15.01.2015 15:52, Skip Montanaro wrote:
> On Thu, Jan 15, 2015 at 8:31 AM, Wolfgang Maier
> <wolfgang.maier at biologie.uni-freiburg.de> wrote:
>>
>> What would be good is if the launcher had an additional flag telling it to not actually start python, but just report the path to it, something like:
>>
>> $ py --dry-run my_script
>>
>> C:\Python34\python.exe
>
> How about:
>
> % python -c 'import sys ; print sys.executable'
> /opt/local/bin/python
>
> ?

What is of interest here is not what is hiding behind "python". It is 
about finding out which python would have been selected by the Python 
launcher based on the shebang line of the script.

Wolfgang



More information about the Python-ideas mailing list