Windows下Python2与Python3切换
Windows 默认安装了启动器py.exe:
cmd:
py -2 #调用Python2
py -3 #调用Python3
程序运行:
py -2 *.py #运行python2程序
py -3 *.py #运行python3程序
下面是一个python2程序的例子,当使用py -3时,运行失败;
Windows下Python2与Python3切换
Windows 默认安装了启动器py.exe:
cmd:
py -2 #调用Python2
py -3 #调用Python3
py -2 *.py #运行python2程序
py -3 *.py #运行python3程序