Python windows 上的解释器版本
Python interpreter version on windows
我对所有不同的 Python-解释器(CPython、PyPy 等)感到困惑。有谁知道 Windows 上的标准 python 使用什么 python-解释器?我在 Official Python Website 上找不到它,当我在命令提示符中键入 py --version
时,它只告诉我 python 版本(即 3.6.0)。任何帮助将不胜感激。
你从python.org得到的是CPython.
您还可以通过执行 import platform
然后 platform.python_implementation()
从 Python 中查看实现。所以你可以从命令行获取它:
py -c "import platform; print(platform.python_implementation())"
您从 https://www.python.org/ 下载的最常见的解释器是 CPython。但是,这个解释器不是标准的;只是常用。 Python 因为语言是由语法定义的,而不是由解释器定义的。
根据您提供的网站link(python.org),如果您安装从它下载的python,解释器是CPython,它是使用最广泛的python。
在windows机器上,python解释器通常安装在C:\Python36
,你可以在pythonshell上查看:
sys.executable
A string giving the absolute path of the executable binary for the Python interpreter, on systems where this makes sense. If Python is unable to retrieve the real path to its executable, sys.executable will be an empty string or None.
import sys
print(sys.executable)
就我而言,它 returns /Users/hzhang/.virtualenvs/env-3.5/bin/python
我对所有不同的 Python-解释器(CPython、PyPy 等)感到困惑。有谁知道 Windows 上的标准 python 使用什么 python-解释器?我在 Official Python Website 上找不到它,当我在命令提示符中键入 py --version
时,它只告诉我 python 版本(即 3.6.0)。任何帮助将不胜感激。
你从python.org得到的是CPython.
您还可以通过执行 import platform
然后 platform.python_implementation()
从 Python 中查看实现。所以你可以从命令行获取它:
py -c "import platform; print(platform.python_implementation())"
您从 https://www.python.org/ 下载的最常见的解释器是 CPython。但是,这个解释器不是标准的;只是常用。 Python 因为语言是由语法定义的,而不是由解释器定义的。
根据您提供的网站link(python.org),如果您安装从它下载的python,解释器是CPython,它是使用最广泛的python。
在windows机器上,python解释器通常安装在C:\Python36
,你可以在pythonshell上查看:
sys.executable A string giving the absolute path of the executable binary for the Python interpreter, on systems where this makes sense. If Python is unable to retrieve the real path to its executable, sys.executable will be an empty string or None.
import sys
print(sys.executable)
就我而言,它 returns /Users/hzhang/.virtualenvs/env-3.5/bin/python