Its worth spending a bit of time describing how to use IDLE. To most, this may not be immediately obvious.
Python 2 is bundled with Mac OS X. However, Python 3 is not. We recommend that you download and install Python 3, and use Python 3 exclusively when running programs associated with this booksite. Perform these steps to download and install Python, IDLE, Tkinter, NumPy, and PyGame: Browse to the Python for Mac download page.
The easiest way is to download the Python installer from the python.org website. Visit Python.org and download the latest available Python installer file; Run the downloaded file and install Python 3.x on Mac. Python 3.6.x requires about 100MB of available disk space.
Launch IDLE shell window
To start, we need to open the python shell window. This is the first window you see when you launch the IDLE application. If you haven’t already, drag the IDLE icon from your Launchpad down into the dock. This will ensure it is ever present whenever you wish to launch.
Idle Download
I am new to python. I am using python 3.5 on mac os x el capitan. I tried using the command 'pip install requests' in the python interpreter IDLE. But it throws invalid 'syntax error'. I read about installing modules is only possible in the command line. So I moved to TERMINAL, but no command is working here also. Downloads Mac OS X; Python Releases for Mac OS X. Latest Python 3 Release - Python 3.9.0; Latest Python 2 Release - Python 2.7.18; Stable Releases. If you are using Python from a python.org 64-bit/32-bit Python installer for Mac OS X 10.6 and later, you should only use IDLE or tkinter with an updated third-party Tcl/Tk 8.5, like ActiveTcl 8.5 installed.
Open editor window
From the shell window, you need to open an editor window. The editor window is where we will write python code. From the IDLE menu bar (click on the shell window to ensure the menu bar is IDLE specific) click File, New File. This will open a new window called “Untitled”
Save File
Its probably a good idea to save the editor window file at this point. This will ensure your code can be saved as you work on it, and it can be retrieved at a later point. From the menu bar, click File, Save As. Each Python file name will have a .py extension. This is provided by default when you name your file.
Write some code
I wanted to prove that my set up worked so I entered some code in the editor window. I wrote a hello world program using the code below. Click File, Save on the IDLE menu when this code has been written in the editor window.
Run program
Executing the code returns (prints) the string values (within quotation marks) stored inside brackets to the python shell window. On the IDLE menu bar click Run, Run Module. This returns the output shown below to the shell window.
Celebrate
Code written and successfully returned to the shell window! To follow on from my previous post, rubber has in fact hit the road. I now have a set up that works and the tools that I need to start learning Python.
Download Idle Python Mac Download
Sidenote – The Python.org website has a a comprehensive guide on using IDLE which goes well beyond this post. For more detail, this is a great place to look.