我是编程新手,更具体地说,是 Python。我正在经历 Robert Sedgewick 的 Introduction to Programming in Python website 的安装过程直到“下载和安装 Booksite Library”部分之前。我的问题发生在:
In the Terminal window issue the command idleX.Y (for example, idle2.7). If an IDLE window appears, then you have installed IDLE properly. Close the IDLE window.
当我安装 Python 2.7 时,我尝试使用命令 idle2.7
,但我收到了 the following response .据我所知,我遵循了 Sedgewick 先生网站提供的所有指示,并且我已经验证 Python 被安装为版本 2.7.10。网上找了答案,找到了一个类似的here on Stack Overflow .不幸的是,为该问题列出的潜在解决方案并没有帮助解决我的问题。在这一点上,我应该提到我正在运行最新版本的 OS X (El Capitan) 的 MacBook Pro(2015 型号)上进行尝试。
感谢您的帮助!
最佳答案
对于 2.7,以下“python”是“启动 2.7 所需的任何字符串”(可能是“python”,可能是“python2”)应该适用于任何操作系统:
python -m idlelib.idle
对于 3.x,.idle
可以省略。在 *nix 中(但不是在 Windows 上),python
可能应该被替换为 python3
。诸如“idle2.7”之类的快捷脚本的可用性取决于脚本是否存在以及是否位于可执行路径上。反过来,这取决于特定的安装程序。在过去的一年里,Python 核心开发人员已经从使用多种不可靠的快捷脚本转向使用 python -m module
,只要可以启动它就是可靠的特定版本的 Python。在 Windows 上,我相信在 Mac 上,在使用 PSF 安装程序后,python
可以替换为 py -x
或 py -x.y
如果一个有多个 python 安装。
关于python - 从终端打开 IDLE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35444316/