In this article, we would discuss how to install Python IDLE in Ubuntu 22.04 release. IDLE is the abbreviation for Integrated Development and Learning Environment. It basically uses tkinter GUI toolkit. We would also like to add here that, the package is platform-independent i.e. we can use it in Windows, macOS and Linux.
Note: Following operations would require you to have superuser privileges. In case you don't have one, then we advise you to contact your System Administrator for assistance.
Install Python IDLE in Ubuntu 22.04
The package is available through standard Ubuntu repository. Therefore, we would first update the repository. This ensures, we get to have the latest version of the package available. Hence, open a terminal and issue the following -
sudo apt update
Thereafter, to install Python IDLE -
sudo apt install idle-python3.10
At the time of writing Python v3.10.1 is available through standard Ubuntu repository. And, the version we have installed for Python is v3.10. So, make necessary changes accordingly.
Besides, you can also install IDLE with -
sudo apt install idle
This will get you the IDLE for Ubuntu's default Python3 version.
To launch the IDLE, we need to issue the following command in the terminal -
or, if you are using IDLE for Ubuntu's default Python3 version -
In Conclusion, we have discussed how to install Python IDLE in Ubuntu 22.04 release.Additional Info -
We will discuss a bit about how to run a Hello World program in Python through IDLE. Launch the IDLE -
It would launch the shell window. There are basically two windows of IDLE we can work with - editor and shell.
To run the editor, Click on File --> New File or Ctrl+N
Now, write the following command in editor window -
and, save it in your desired directory.
Next, to execute the code, in the editor itself - click on Run --> Run Module or press F5
You would see the desired output in the shell window.