Go to: Na-Rae Han's home page  

Python 3 Notes

        [ HOME | LING 1330/2330 ]

Trying out Python IDLE for the First Time

<< Previous Note           Next Note >>

How-to Video


**Click the icon on bottom right to view full-screen.

Summary

  • IDLE is the Python environment we will be using. Look for "IDLE (Python 3.5 32-bit)" entry in the Programs list, under Python 3.5.
  • The IDLE shell window opens up. You can again type in print("hello!") and so forth, and the shell will do the printing. As you can see, it's interactive. Python responds to every line of code you enter.
  • Opening up a new window will create a script file window. Here, print("hello!") does not immediately produce output. That is because this is a script file editing window, which means the commands won't execute until the file is saved and run.
  • You can run the script by going "Run --> Run Module" or simply by hitting F5 (on some systems, Fn + F5).
  • Before running, IDLE prompts you to save the script as a file. Choose a name ending in .py ("hello.py") and save it on Desktop.
  • The script will then run in the IDLE shell window. Since you now have a saved script, you can run it again (and again, and again...).
  • I also have the IDLE shortcut pinned in the START menu (how to do that in next tutorial). I can launch IDLE from there.
  • I can then open up the saved "hello.py" file and run it again, through the "Open..." dialogue.
  • You can also open IDLE directly from your Python script file. Right click the file, then choose "Edit with IDLE".
  • Rather than going through the "Run..." menu, learn to use F5 (on some systems, Fn + F5) to run your script. It's much quicker.

Next Step

You need to configure a few things. I will show you how in the next Python notes.