在 Linux 上调用 Python IDLE

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14097795/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 18:09:15  来源:igfitidea点击:

Invoking Python IDLE on Linux

linuxpython-idle

提问by capngp

I am trying to set up a Python development environment. I have Python 2.7.3 running on Linux mint14. I downloaded IDLE and installed it. Clean installs and Python runs just fine.

我正在尝试建立一个 Python 开发环境。我在 Linux mint14 上运行 Python 2.7.3。我下载了 IDLE 并安装了它。干净安装和 Python 运行得很好。

So how do I invoke IDLE? No IDLE in my path: which idlereturns nothing. man idlereturns nothing pertaining to an editor. Nothing in /usr/lib or /usr/local/lib. Calling idle()inside the Python interpreter doesn't work. Invoking pythonbrings up a shell, not IDLE. No menu entry for IDLE in Linux. No import library named IDLE that Python can find. 3 O'Reilly books consulted and not a word about invoking IDLE in Linux. YouTube videos of Python favor Windows, not Linux. Web searches have so far been unsuccessful.

那么如何调用 IDLE 呢?我的路径中没有空闲:不which idle返回任何内容。man idle不返回与编辑器有关的任何内容。/usr/lib 或 /usr/local/lib 中没有任何内容。idle()在 Python 解释器内部调用不起作用。调用python会调出一个 shell,而不是 IDLE。Linux 中没有 IDLE 的菜单项。没有 Python 可以找到的名为 IDLE 的导入库。参考了 3 本书 O'Reilly 书籍,但没有提及在 Linux 中调用 IDLE。Python 的 YouTube 视频有利于 Windows,而不是 Linux。迄今为止,网络搜索均未成功。

回答by Ned Deily

I'm not familiar with lintmyself but, since it claims to be Debian based, try installing the idlepackage:

我对lint自己不熟悉,但由于它声称是基于 Debian 的,请尝试安装该idle软件包:

sudo apt-get install idle

That should pull in all the appropriate packages for the installed version of Python. Then you should just be able to start idle with:

这应该为已安装的 Python 版本引入所有适当的包。然后你应该可以开始空闲:

idle

in a terminal window.

在终端窗口中。