Topics

Introduction to IDLE

Welcome to another tutorial, here you will get familiar with the development environment which will be used throughout this tutorial series to run any Python code. The IDE is virtually the best environment to write and execute your python code as you are learning. Interestingly, there is no need for another installation as it comes bundled with Python's compiler. 

Now, let’s open the IDLE, just type IDLE in Windows/Mac/Linux search bar and it will appear.

IDLE Python

In the image above, you can see the cursor blinking right after ‘>>>’. It is where you will be writing your code, and then the currently running version of Python is also mentioned at the top.

When using the IDLE, we write code line by line. So you can type one line to handle one thing and press enter to execute it. The IDLE behaves like a terminal or commands prompt.

Also, a python file can be created which will contain the complete multiline program and can be executed using IDLE. All python script has an extension ‘.py’.

However, Python takes some time to compile, as its compilation is not fast, hence, writing the example code in a file, then compiling the whole code again and again gets tedious and it does not go well for beginners. 

When the IDLE is opened, a new session is created, that saves all the lines of code that you write and execute in that one window as a single program. Because of this, whatever you wrote above may affect what you will write in the new session. For example, using a variable. Check out the example below:

IDLE is pleasant to use, as you can choose custom colors for the background and text, to give it your style. It also has an auto-complete feature, which predicts what you are typing and suggests it just like a Google search.

Most importantly, Python is available for all major operating systems.