How to run Python IDLE on a Mac
Step 1
Start by opening Launchpad
Step 2
Click IDLE. (If there's no IDLE icon to click, Python 3 may not be installed correctly.Follow these instructions to install it.
Step 3
The Python Shell opens. It's similar to the Windows, Mac, and Linux terminals. Appendix C in the book shows you how to run Python in a terminal.
Step 4
We're going to use the IDLE editor. It allows you to create a Python program that you can save. To open the IDLE editor, begin by clicking File
Step 5
Click New File.
You're now in the editor.
Step 6
Writing some code. For eg: Carefully type in this code:
import turtle
turtle.fd(100)
The command import turtle
tells Python to borrow the turtle graphics library for our program.
turtle.fd(100)
means move the turtle forward 100 steps in the current direction.
Step 7
Save the program. Press ctrl-s. Save the file to the specific folder for python projects as shapes.py
Step 8
To run the shapes.py
program, click Run, then Run Module.
output window opens and displays your results
Top comments (1)
Ankush.com