Python aliases under Windows?

Chris Angelico rosuav at gmail.com
Tue Apr 3 05:27:19 EDT 2018


On Tue, Apr 3, 2018 at 7:24 PM, Kirill Balunov <kirillbalunov at gmail.com> wrote:
> Perhaps this is a silly question but still...There is PEP 394 "The "python"
> Command on Unix-Like Systems" which I find very reasonable, no matter how
> it is respected. Why was not _somewhat_ the same done for Windows?
>
> Sometimes I use, especially in IPython, to run externally:
> ! python3 -m dis <module>
> ! python3 -m timeit ...
> ! python3 -m pip install ...
>
> And to make this work the same under Windows, the first step which I do
> after installation is to copy `python.exe` and rename it to `python3.exe`
> (for python 2.7 copy `python.exe` and rename it to `python2.exe`). May be
> there is a better way to do this under Windows, I would like to know?  This
> copy-rename works for me, but it will not work for someone who does not
> have administrative rights.
>
> p.s.: I know there is a `py` launcher under Windows, but is does not help
> in this situation.

Why doesn't it? That's what its job is.

ChrisA


More information about the Python-list mailing list