How to Use the Python IDLE Shell
00:00 How to Use the Python IDLE Shell. The shell is the default mode of operation for Python IDLE. When you click on the icon to open the program, the shell is the first thing that you can see. Here, you can see a blank Python interpreter window.
Here you can see
Hello from IDLE! to the screen. This is the most basic way to interact with Python IDLE. You type in commands one at a time, and Python responds with the result of each command.
It will act as if you’ve just started a fresh instance of Python IDLE. The shell will forget about everything from its previous state. Here, you can see a variable,
x, has been defined with the value of five and printing it out returns that value. However, after the shell has been restarted, x is no longer defined and this generates a
01:18 You can also interrupt the execution of the shell from this menu or by using the keyboard shortcut, which is typically Ctrl+C. This will stop any program or statement that’s running in the shell at the time of interruption.
Become a Member to join the conversation.