python解释器调用_Python初学之调用Python解释器(Python3.6)

The Python interpreter is usually installed as /usr/local/bin/python3.6 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:

python3.6

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.)

在类Unix系统中如Linux,Python解释器通常安装在 /usr/local/bin/python3.6目录,在shell中切换到python安装目录,在shell中输入:Python 3.6,启动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:

setpath=%path%;C:\python36

Windows系统中,Python常安装在C:\python36目录,当然您在安装时,也可以选择更改安装路径,安装好后,你可以在DOS窗口即命令行下输入set path=%path%;C:\python36来配置变量,让windows自动识别。设置好之后,就可以执行python命令了。

笔者补充:在winows中,如果您没有设置变量,或者是下载的免安装包,您可以通过输入路径的方式来执行Pyhon命令和脚本,比如python在F盘 输入F:\python-3.6.4\python F:\test\test.py 就可以执行F:\test\test.py脚本。

(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,Windows在control-Z)主提示符解释器会以10状态退出。如果不工作,你可以退出解释器通过键入以下命令:quit()。

u=2561814622,2914155610&fm=173&app=25&f=JPEG?w=640&h=360&s=721C7E8E57A3D8E45A2B826E03007078

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值