IDLE is an abbreviation for the integrated development learner environment.
IDLE is a preinstalled Python IDE that is written using the Python standard library tkinter. tkinter is a Python standard library which is used for graphical user interfaces.
IDLE Shell
The IDLE Shell can be launched from the Anaconda PowerShell Prompt using the PowerShell command:
idle

The IDLE Shell looks similar to a PowerShell Prompt running Python and can be used to input Python code:

Notice that when IDLE is launched, the Anaconda PowerShell Prompt will be busy. Essentially a while loop is running in the Anaconda PowerShell Prompt to keep idle open. It will remain busy until IDLE is closed:

Code Completion and Docstrings
If p
is input followed by a ↹
, a list of Python builtins identifiers displays:

And if a function is input with open parenthesis for example print(
a docstring will display:

If a Python standard module is imported such as:
import builtins
And if builtins.
is input followed by a ↹
, a list of Python identifiers from that module displays:

If the following object instance is instantiated:
obj1 = object()
Inputting obj1.
followed by a ↹
, shows a list of Python object based data model identifiers:

If the following string instance is instantiated:
str1 = 'hello'
Inputting str1.
followed by a ↹
, shows a list of Python str identifiers:

Inputting str1._
followed by a ↹
, shows a list of Python object based data model identifiers that the str class also has:

If a third-party data science library such as numpy is imported using the alias np:
import numpy as np
Inputting np.
followed by a ↹
, shows a list of identifiers from the numpy library:

IDLE Doc
The IDLE Doc is essentially an equivalent to Notepad that shows code completion.
To open IDLE Doc, select File → New File in the IDLE Shell:

This will open up IDLE Doc in a seperate Window. Select File → Save As…

Then save the file as a Python Script file (.py file extension):

Code completion will now work in a similar manner to seen in the IDLE Shell:




Code completion with the IDLE Doc will only work with third-party libraries and instances of classes from third-party libraries if they are previously imported in the IDLE Shell. If a script file includes
import numpy as np
And np.
is input followed by a ↹
the completions display:

If the same is done with pandas which is imported in the script file but not in the Shell, inputting pd.
followed by a ↹
does not display any identifiers:

Importing pandas in the Shell:

Now allows identifiers to display in the script editor:


A simple script file:
print('Hello World!')
can be created:

It can be run by selecting, run → run module:

The print statement created in the script file will now be seen in the Shell:

A script file which uses the data science libraries can be created:
import numpy as np import pandas as pd import matplotlib.pyplot as plt x = np.array([0, 1, 2, 3, 4]) y = np.array([0, 2, 4, 6, 8]) df = pd.DataFrame({'x': x), 'y': y}) plt.plot(df['x'], df['y']) plt.show()

This script file can be run:

IDLE uses the TkAgg backend for Matplotlib and the plot displays in a seperate window. The console will remain busy until the plot is closed:

When IDLE is closed, the Anaconda PowerShell Prompt will no longer be busy and a new Prompt will appear:
