Presentation is loading. Please wait.

Presentation is loading. Please wait.

IDLE An IDE for Python bundled with the program release Click on IDLE (Python GUI) in the Start menu under the Python program group  Get the IDLE Python.

Similar presentations


Presentation on theme: "IDLE An IDE for Python bundled with the program release Click on IDLE (Python GUI) in the Start menu under the Python program group  Get the IDLE Python."— Presentation transcript:

1 IDLE An IDE for Python bundled with the program release Click on IDLE (Python GUI) in the Start menu under the Python program group  Get the IDLE Python Shell window, like the Python command line

2 Under the File menu, click New Window (or Ctrl+N)  Gives a window to compose a new Python file (module)

3 Type in the new code Note the color coding In the Run menu, click Run Module (or F5) If you didn’t save the file, you get an alert Click OK, and a save window pops up

4 Then program output (and input, if any) occurs in the Python Shell

5 When you start a new IDLE session, to open this file again in a program window,  click Open in the File menu in the Python Shell, and  navigate to this file  Or put the mouse cursor on Recent Files in the File menu, and click on this file in the resulting list of recently accessed files It's common to write a.py in some editor (e.g., Notepad++) then open and run it in IDLE  Correct errors directly in the IDLE program window  Notepad++ will ask whether you want to update your file to what has been changed in IDLE (You generally do)

6 In the Windows explorer, if you're in a folder with a.py file, right click on its icon to pop up a menu of operations on it Click on Edit with IDLE  Opens an IDLE program window with the contents of that file  Clicking Run Module in the Run menu opens IDLE Python Shell window in which the file is execute

7 Files with just function or class definitions ("modules") don't produce output when they're run  The prompt advances in the IDLE Python Shell (and nothing else) In the Shell, at the prompt, can now call the functions and classes defined in the file  Running the file has executed the function and class definitions

8 IDLE locates syntax errors Suppose we omit the ‘ : ’ in while b < n Selecting Run Module in the Run menu of the program window results in an alert The error is highlighted in the listing in the program window Dismiss the alert and provide the missing colon  The highlighting goes away

9 To reproduce a previous command, type the first character or so (enough so it’s the 1 st command starting with that sequence in a search back through the history) then type Alt-p  The up-arrow key doesn’t work for moving back in the history When you come to the opening ‘(‘ for the argument list of a function (predefined or user-defined), IDLE shows you the signature for that function—e.g.,


Download ppt "IDLE An IDE for Python bundled with the program release Click on IDLE (Python GUI) in the Start menu under the Python program group  Get the IDLE Python."

Similar presentations


Ads by Google