python system interpreter_2. Using the Python Interpreter:使用Python解释器

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值