Python is part of the MacOS environment. Tiger (MacOS 10.4) includes
Python 2.3.5 and IDLE. Leopard (MacOS 10.5) includes Python 2.5.1.
Generally, you don't need to do much to get started. You'll just need to
locate the various Python files. Look in
for the relevant files.
In order to upgrade software in the Macintosh OS, you must know the
administrator, or “owner” password. If you are the person who
installed or initially setup the computer, you had to pick an owner password
during the installation. If someone else did the installation, you'll need
to get the password from them.
The Mac OS installation of Python has three broad steps.
- Pre-installation: make backups and download the installation
- Installation: install Python.
- Post-installation: check to be sure everything
We'll go through each of these in detail.
Before installing software, back up your computer. While you can't
easily burn a DVD of everything on your computer, you can usually burn a
DVD of everything in your Mac OS X Home directory.
I've never had a single problem installing Python. I've worked with
a number of people, however, who either have bad luck or don't read
carefully and have managed to corrupt their Mac OS installation by
downloading and installing software. While Python is safe, stable,
reliable, virus-free, and well-respected, you may be someone with bad luck
who has a problem. A backup is cheap insurance.
You should also have a folder for saving your downloads. You can
create a folder in hour
downloads. I suggest that you keep all of your
various downloaded tools and utilities in this folder for two reasons. If
you need to reinstall your software, you know exactly what you downloaded.
When you get a new computer (or an additional computer), you know what
needs to be installed on that computer.
Download. After making a backup, go to the www.python.org web site and look for
the Download area. In here, you're looking for the pre-built Mac OS X
installer. This book will emphasize Python 2.5. In that case, the kit is
When you click on the filename, your browser should start downloading
the file. Save it in your
Backup. Now is a good time to make a second backup. Seriously. It is still
At this point, you have everything you need to install Python:
- A backup
- The Python installer
When you double-click the
file, it will create a disk image named
. This disk image has your
license, a ReadMe file, and the
When you double-click the
it will take all the necessary steps to install Python on your computer.
The installer will take you through seven steps. Generally, you'll read
the messages and
Introduction. Read the message and click .
Read Me. This is the contents of the ReadMe file on the installer disk
image. Read the message and click
License. You can read the history of Python, and the terms and conditions
for using it. To install Python, you must agree with the license. When
you click , you will get a pop-up window
that asks if you agree. Click to install
Select Destination. Generally, your primary disk drive, usually named
Macintosh HD will be highlighted with a green
arrow. Click .
Installation Type. If you've done this before, you'll see that this will be an
upgrade. If this is the first time, you'll be doing an install. Click
You'll be asked for your password. If, for some reason, you aren't
the administrator for this computer, you won't be able to install
software. Otherwise, provide your password so that you can install
Finish Up. The message is usually "The software was successfully installed".
Click to finish.
In your Applications folder, you'll find a
2.5 folder, which contains a number of applications.
for the relevant files. In the
you'll find the various applications. The
file will launch IDLE for us.
Once you've finished installation, you should check to be sure that
everything is working correctly.
Now you can go to your
and double click the IDLE application. This
will open two windows, the Python Shell window is
what we need, but it is buried under a Console
Here's what you'll see in the Python Shell window.
Python 2.5.1 (r251:54863, Oct 5 2007, 21:08:09)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "copyright", "credits" or "license()" for more information.
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
The menu bar will have a menu named
the menu item . Use this to finish
using IDLE for now, and skip to the next chapter.
You may notice a
. This will launch
Safari to show you the Python documents
available on the Internet.
menu. This has the
menu item, which you can access
through the menu or by hitting