后浪云Python教程:python里launcher是什么

后浪云Python教程:python里launcher是什么插图

什么是 Python launcher

以下是官方文档给出的解释

New in version 3.3.
The Python launcher for Windows is a utility which aids in locating and executing of different Python versions. It 
allows scripts (or the command-line) to indicate a preference for a specific Python version, and will locate and 
execute that version.
Unlike the PATH variable, the launcher will correctly select the most appropriate version of Python. It will prefer 
per-user installations over system-wide ones, and orders by language version rather than using the most recently 
installed version.

翻译:

3.3版本新增功能

适用于 Windows 的 Python 启动器是一个实用组件,可帮助您定位和执行不同的 Python 版本。它允许脚本(或命令行)为特定的 Python 版本指示首选项,定位并执行该版本。

不同于 PATH 变量,Python Launcher 将正确选择最合适的 Python 版本。它更喜欢每个用户在系统范围内的安装,并且运行指定的 Python 版本,而不是使用最近安装的版本。

Python Launcher 的位置

在安装 Python 3.3 以上版本的 Python 时,我们可以看到下图中的一个选项,当我们勾选时,系统便会帮助我们自动安装 Python Launcher。

后浪云Python教程:python里launcher是什么插图1

图中标注的小字告诉我们,安装 Python Launcher 后可以通过全局命令 ‘py’ 来更方便地启动 Python。不勾选 launcher 项时,系统则不会安装 Python Launcher (但默认情况下该工具都是被勾选的)。

THE END