[Python-ideas] pep 397

Steven D'Aprano steve at pearwood.info
Thu Jan 15 16:54:06 CET 2015


On Fri, Jan 16, 2015 at 01:47:46AM +1100, Chris Angelico wrote:
> On Fri, Jan 16, 2015 at 1: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
> 
> Ooh that would be a nice feature. I'd be inclined to call it --query
> rather than --dry-run, but that's just bike-shedding. 

Sometimes bike-shedding has a bad reputation. Option names should 
reflect what they do. --dry-run suggests that it will run the script 
except for anything destructive (e.g. writing or deleting files, 
printing a 300 page report). --query is better, but query what?

This isn't a common command that needs to be short even at the expense 
of being cryptic, so how about a self-documenting switch like:

 --which-executable
 --which-python

and -w for those who insist on having short cryptic switches :-)


-- 
Steven


More information about the Python-ideas mailing list