py
command comes with Python3.x and allow to choose among multiple Python interpreters. For example if you have both Python 3.4 and 2.7 installed, py -2
will start python2.7 and py -3
will start python3.4 . If you just use py
it will start the one that was defined as default.
So the official way would be to install Python 3.x, declare Python 2.7 as the default, and the py
command will do its job.
But if you just want py
to be an alias of python
, doskey py=python.exe
as proposed by @Nizil and @ergonaut will be much simpler... Or copying python.exe to py.exe in Python27 folder if you do not want to be bothered by the limitations of doskey
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…