TranslateProject/sources/tech/20230228.0 ⭐️ How to Install IDLE Python IDE in Ubuntu and Other Linux.md
2023-03-03 08:50:09 +08:00

111 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[#]: subject: "How to Install IDLE Python IDE in Ubuntu and Other Linux"
[#]: via: "https://www.debugpoint.com/install-idle-ubuntu-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install IDLE Python IDE in Ubuntu and Other Linux
======
**Pythons default IDE IDLE is not installed by default in Ubuntu and other distros. Learn how to install it in this guide.**
IDLE (**I**ntegrated **D**evelopment and **L**earning **E**nvironment) is a [Python IDE][1], written in Python language itself and usually gets installed in Windows as part of [Python installation][2]. It is ideal for beginners and straightforward to use. For those who are learning Python, such as students, it can be a good IDE to start with.
Basic features such as syntax highlighting, smart ident, and auto-completion are some of the features of this IDE. You can always learn more about the IDLE features in the official [documentation][3].
### IDLE in Ubuntu and other Linux
All Linux distributions, including Ubuntu, come with Python pre-installed. Even if you manually upgrade or install Python versions, the IDLE IDE doesnt come with that. You have to install it manually.
For **Debian, Ubuntu, Linux Mint and related distribution** open a terminal and run the following command to install IDLE.
```
sudo apt update
```
```
sudo apt install idle3
```
Hit yes when the command asks you whether you want to install IDLE or not. After the command is complete, IDLE will be installed in your Ubuntu system.
For **Fedora, RHEL, CentOS**, use the following command to install it.
```
sudo dnf update
```
```
sudo dnf install idle3
```
**Arch Linux** users can install it using the following command.
```
sudo pacman -S python tk
```
![IDLE install and run in Ubuntu][4]
### Launching IDLE and writing a sample program to test
After the installation in Ubuntu, Debian, Linux Mint, and Fedora you can find the IDLE icon in the application menu. See below.
![IDLE icon in the application menu][5]
If you are using Arch Linux, you need to run below from the command line to launch IDLE.
```
idle
```
Once you launch IDLE, you should see the main window, as shown in the image below.
![IDLE editor main window][6]
By default, it shows you a shell where you can directly execute Python codes in each line. It works like any shell interpreter. And when you hit enter, you get the output, and the three “>” symbols go to the next line for the next command.
![Running a simple Python statement in IDLE][7]
IDLE also allows you to open any .py file from its file menu. It will open the file in a separate window where you can make changes and run it directly. You can run using F5 or from the option Run > Run Module.
![A python file opened from IDLE][8]
![Option to Run the file using menu][9]
The output is shown in a separate output window. From the output window, you can start debugging, step into a line or file, view stack trace and other options.
![Output is shown in a separate output window of IDLE][10]
### Closing Notes
Now you learned how to install the IDLE IDE in Ubuntu and other distributions and how to run a statement or a Python program. IDLE can be a good starting point for beginners to grasp the basics before heading over to more complex IDEs.
I hope this guide helps you on your Python journey.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-idle-ubuntu-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed/
[1]: https://www.debugpoint.com/5-best-python-ide-code-editor/
[2]: https://www.debugpoint.com/install-python-windows/
[3]: https://docs.python.org/3/library/idle.html
[4]: https://www.debugpoint.com/wp-content/uploads/2023/02/IDLE-install-and-run-in-Ubuntu.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2023/02/IDLE-icon-in-the-application-menu.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2023/02/IDLE-editor-main-window.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2023/02/Running-a-simple-Python-statement-in-IDLE.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2023/02/A-python-file-opened-from-IDLE.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2023/02/Option-to-Run-the-file-using-menu.jpg
[10]: https://www.debugpoint.com/wp-content/uploads/2023/02/Output-is-shown-in-a-separate-output-window-of-IDLE.jpg