How to install Python IDLE in Linux

Table of Contents

If you have just started learning Python, you probably are using IDLE. IDLE is a cross-platform application used by many beginners. If IDLE is not already installed on your Mac or Linux, this article will help you to install it on a Linux box.

Installing Python IDLE in Linux

Most new Linux comes with Python installed which is bundled with IDLE. If for some reason Python is not there in your Linux distro, you can install it using a default package manager.

Run the following command Debian or Ubuntu terminal to install IDLE

sudo apt-get install idle3 # this command installs IDLE for Python3, if you are using Python2+, you can just change idle3 to idle in the command.How to install Python IDLE in Linux

If you want to install IDLE in CentOS, Red Hat, or Fedora, run the following command

sudo yum install python3-tools

Once the installation is done, you can open IDLE from the start menu, or type idle in the terminal. It should look something like the below:

IDLE for Linux

IDLE has to autocomplete support, you can enable it using ALT + Space Linux and CTRL + Space Mac.

Write Hello Word in Python IDLE

To create a new Python file, select the file from the menu and click the new file. You can write your program and save the file by selecting save from the file menu.

Run the program by pressing F5 or selecting “Run Module” from Run Menu.

Run python code in IDLE in Linux

Written by

I am a software engineer with over 10 years of experience in blogging and web development. I have expertise in both front-end and back-end development, as well as database design, web security, and SEO.

Leave a Reply

Your email address will not be published. Required fields are marked *