IDLE (Python)
![]() Ubuntu中的IDLE,设置高亮的交互环境 | |
原作者 | Guido van Rossum |
---|---|
首次发布 | 1998年12月22日 |
当前版本 | 3.12.9[1]![]() |
源代码库 | |
编程语言 | Python |
类型 | 集成开发环境 |
许可协议 | |
网站 | docs |
IDLE (Integrated Development and Learning Environment的简称)[2][3] 是一个Python的集成开发环境,自1.5.2b1以来已与该语言的默认实现捆绑在一起。 [4][5]许多Linux发行版中,它是Python中可选部分的包装。它完全使用Python和Tkinter GUI工具包( Tcl/Tk的包装函数)编写。
IDLE是开发 python 程序的一个基本的IDE,比较适合初学者尤其是在教育环境中使用,是非商业Python开发的不错的选择。它可以跨平台,避免了功能混乱。
软件界面
打开 IDLE 后,会出现一个增强的交互解释器窗口,它具有比基本的交互命令提示符更多的功能。IDLE中会显示“三个尖括号”提示符(>>>),这时就可以输入Python代码了。
功能
根据自带的README文件,IDLE的主要功能有:
编辑选项
编写 Python程序时常用的IDLE编辑选项:
(1)Undo:撤销上一次的修改。
(2)Redo:重复上一次的修改。
(3)Cut:将所选文本剪切至剪贴板。
(4)Copy:将所选文本复制到剪贴板。
(5) Paste:将剪贴板的文本粘贴到光标所在位置。
(6)Find:在窗口中查找单词或模式。
(7) Find in files:在指定的文件中查找单词或模式。
(8) Replace:替护单词或模式。
(9) Go to line:将光标定位到指定行首。
(10) Expand Word:单词自动完成
对于 Format菜单,常用的选项及解释如下所示:
(1) Indent region:使所选内容右移一级、即增加缩进量。
(2) Dedent region:使所选内容组左移一级,即减少缩进量。
(3) Comment Out Region:将所选内容变成注释。
(4) Uncomment region:去除所选内容每行前面的注释符
(5) New Indent width:重新设置制表位缩进宽度,范围为2~16,宽度为2(相当于1个空格)
(6) Toggle tabs:打开或关闭制表位。
后退 ctrl+z
重做 ctrl+Shift+z
加缩进 ctrl+]
减缩进 ctrl+[
加注释 Alt+3
去注释 Alt+4
新建文件 ctrl+n
运行文件 F5
复制 ctrl+c
粘贴 ctrl+v
保存 ctrl+s
命名
Author Guido van Rossum says IDLE stands for "Integrated Development and Learning Environment",[6] and since Van Rossum named the language Python after the British comedy group Monty Python, the name IDLE was probably also chosen partly to honor Eric Idle, one of Monty Python's founding members.[7][8]
另见
参考来源
- ^ Changelog. [2025年4月1日] (英語).
- ^ From the Help > About screen
- ^ IDLE — Python 3.9.5 documentation. [2020-06-04]. (原始内容存档于2020-06-04).
- ^ Subject: IDLE 0.1 -- a Python IDE 互联网档案馆的存檔,存档日期2018-09-25., By Guido van Rossum - 16 Nov 1998 - comp.lang.python, At the conference I mentioned a few times that I was working on a Tkinter-based IDE for Python. I've decided to use the paradigm "release early and often" for this piece of software (especially since I don't expect I'll have much time to work on it), so version 0.1 (essentially a dump of my directory) is now sitting in the contrib directory ftp.python.org.
- ^ IDLE 0.1 was distributed with the Python 1.5.2b1 release on 12/22/98., From: \Python-1.5.2\Tools\idle\NEWS.txt
- ^ IDLE — Python 3.9.2 documentation. docs.python.org. [2021-02-26].
- ^ Lutz, Mark & Ascher, David (2004). Learning Python, p. 40. O'Reilly Media, Inc. ISBN 978-0-596-00281-7.
- ^ Hammond, Mark & Robinson, Andy (2000). Python Programming On Win32: Help for Windows Programmers, p. 59. O'Reilly Media, Inc. ISBN 978-1-56592-621-9.