Signup/Sign In

Introduction to IDLE - Default Python IDE

In this section, you will get familiar with the development environment which has been used throughout this tutorial series to run python code. It's probably the best environment to write and execute the python code while learning. Moreover, there is no extra installation required since it comes bundled with Python's compiler. So, if you have followed the installation steps as given in the last tutorial, you might already be having IDLE in your system.

It's time to open IDLE now, you can do it by typing IDLE in Windows/Mac/Linux search bar and it should appear.

Introduction to IDLE

This is pretty much how it looks. You can see the cursor blinking right after >>>. This is where you will be writing your code. Also, the current running version of Python is also mentioned at the top.

Introduction to IDLE

In IDLE we write code line by line. One line will handle one thing. You type whatever you want in that line and press enter to execute it. IDLE works more like a terminal or command prompt - You write one line, press enter, it executes.

We can also create python file which will contain the complete multiline program and can execute that using IDLE as well. A python script has an extension .py.

Python takes some time to compile, its compilation is not fast, thus writing the example code in a file, then compiling the whole code again and again gets tedious and is not suited for beginners. When we open the IDLE, a session is created, which saves all the lines of code that you write and execute in that one window as a single program. This is the reason why, what you wrote above may affect what you will write later, eg. using a variable. Here is a preview of how we will be typing in IDLE.

Introduction to IDLE

IDLE is pretty neat in its own way. You can choose custom colours for the background and text, to give it your own style. There is an auto-complete feature, which predicts what you are typing and suggests it (pretty much like Google search).

Introduction to IDLE

Above all, it is available for all major operating systems!