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