Using the Python Interpreter 使用Python 解释器
2.1. Invoking the Interpreter 调用解释器
The Python interpreter is usually installed as /usr/local/bin/python3.7 on those machines where it is available; putting /usr/local/bin in your Unix shell’s search path makes it possible to start it by typing the command:
在能够使用Python的机器中,Python解释器经常安装在 /usr/local/bin/python3.7. 把 /usr/local/bin 这个目录加在Unix shell 的搜索路径,就能在Shell.输入下面的命令来启动:
Python3.7
to the shell. [1] Since the choice of the directory where the interpreter lives is an installation option, other places are possible; check with your local Python guru or system administrator. (E.g., /usr/local/python is a popular alternative location.)
Python解释器的路径的选择是安装时的选项,其他路径也是可以的。可以让你的Python大师或系统管理员来检查。(例如,/usr/local/python 这个路径是另外一个比较流行的选择)
On Windows machines, the Python installation is usually placed in C:\Python36, though you can change this when you’re running the installer. To add this directory to your path, you can type the following command into the command prompt in a DOS box:
在Windows的机器中,Python经常安装在C:\Python36,即使你可以在执行安装程序的时候修改路径。如果要把这个目录加到环境变量中的Path中,你可以在Dos命令行提示器中输入下面的命令:
set path=%path%;C:\python36
Typing an end-of-file character (Control-D on Unix,Control-Z on Windows) at the primary prompt causes the interpreter to exit with a zero exit status. If that doesn’t work, you can exit the interpreter by typing the following command: quit().
在命令行提示器中输入结束符(Unix是Control-D, Windows是Control-Z)可以让解释器以状态‘0’退出。如果这个不起作用,你可以输入下面的命令来退出解释器:quit().
The interpreter’s li