On Wed, Oct 19, 2011 at 10:17 PM, Sam Partington
<[email protected]> wrote:
> Ok ok, I give up. Apparently I am the only one who wants to be able
> to run different versions of python based on the shebang line AND add
> occasional arguments to the python command line.
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. "-i" in
particular is invaluable for the following scenario:
- app crashes with exception
- rerun with "-i"
- at the interpreter prompt, do "import pdd; pdb.pm()"
- poke around in the offending frame directly rather than sprinkling
print statement fairy dust around everywhere potentially relevant
And, of course, the "-m" use case has already been mentioned to invoke
modules by module name rather than file name ("python -m timeit",
anyone?)
Cheers,
Nick.
--
Nick Coghlan | [email protected] | Brisbane, Australia
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com