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()。