Python 3.3随附PyLauncher(py.exe),该文件安装在C:
Windows目录中(已经在路径中),并允许通过命令行执行所有已安装的Python,如下所示:
Windows PowerShellCopyright (C) 2009 Microsoft Corporation. All rights reserved.PS C:> pyPython 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> ^ZPS C:> py -2Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> ^ZPS C:> py -3Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>>
请注意,如果同时安装了2.X和3.X,则默认的Python是2.X(在更高版本的Python中为3.X),但是可以通过
-3开关覆盖该默认值,也可以通过设置
PY_PYTHON环境变量来更改默认值。
另外,如果最后安装Python
3.3并注册扩展名,则PyLauncher将是.py文件的默认程序,并
#!在脚本顶部添加特殊注释将指定用于该脚本的Python版本。这使您可以在桌面上拥有Python
2和Python 3文件,只需双击它们即可为该脚本运行正确版本的Python。
请参阅Python
3文档中的Windows的Python启动器。



