Before you do anything else, check whether you already have a recent Python on your machine. If you are working on Linux, Mac OS X, or some Unix systems, Python is probably already installed on your computer, though it may be one or two releases behind the cutting edge. Heres how to check:
If you find a Python, make sure its a recent version. Although any recent Python will do for most of this text, this edition focuses on Python 3.3 and 2.7 specifically, so you may want to install one of these to run some of the examples in this book.
Where to Get Python
If there is no Python on your machine, you will need to install one yourself. The good news is that Python is an open source system that is freely available on the Web and very easy to install on most platforms.
You can always fetch the latest and greatest standard Python release from http://www.python.org, Pythons official website. Look for the Downloads link on that page, and choose a release for the platform on which you will be working. Youll find prebuilt self-installer files for Windows (run to install), Installer Disk Images for Mac OS X (installed per Mac conventions), the full source code distribution (typically compiled on Linux, Unix, or OS X machines to generate an interpreter), and more.
Although Python is standard on Linux these days, you can also find RPMs for Linux on the Web (unpack them with rpm ). Pythons website also has links to pages where versions for other platforms are maintained, either at Python.org (http://www.python.org) itself or offsite. For example, you can find third-party Python installers for Googles Android , as well as apps to install Python on Apples iOS .
A Google web search is another great way to find Python installation packages. Among other platforms, you can find Python prebuilt for iPods, Palm handhelds, Nokia cell phones, PlayStation and PSP, Solaris, AS/400, and Windows Mobile, though some of these are typically a few releases behind the curve.
If you find yourself pining for a Unix environment on a Windows machine, you might also be interested in installing Cygwin and its version of Python (see http://www.cygwin.com). Cygwin is a GPL-licensed library and toolset that provides full Unix functionality on Windows machines, and it includes a prebuilt Python that makes use of all the Unix tools provided.
You can also find Python on CD-ROMs supplied with Linux distributions, included with some products and computer systems, and enclosed with some other Python books. These tend to lag behind the current release somewhat, but usually not seriously so.
In addition, you can find Python in some free and commercial development bundles. At this writing, this alternative distributions category includes:
ActiveState ActivePython
A package that combines Python with extensions for scientific, Windows, and other development needs, including PyWin32 and the PythonWin IDE
Enthought Python Distribution
A combination of Python and a host of additional libraries and tools oriented toward scientific computing needs
Portable Python
A blend of Python and add-on packages configured to run directly from a portable device
Pythonxy
A scientific-oriented Python distribution based on Qt and Spyder
Conceptive Python SDK
A bundle targeted at business, desktop, and database applications
PyIMSL Studio
A commercial distribution for numerical analysis
Anaconda Python
A distribution for analysis and visualization of large data sets
This set is prone to change, so search the Web for details on all of the above, and others. Some of these are free, some are not, and some have both free and nonfree versions. All combine the standard Python freely available at http://www.python.org with additional tools, but can simplify install tasks for many.
Finally, if you are interested in alternative Python implementations, run a web search to check out Jython (the Python port to the Java environment) and IronPython (Python for the C#/.NET world), both of which are described in . Installation of these systems is beyond the scope of this book.
Installation Steps
Once youve downloaded Python, you need to install it. Installation steps are very platform-specific, but here are a few pointers for the major Python platforms (biased in volume toward Windows, only because that is the platform where most Python newcomers are likely to encounter the language first):
Windows
For Windows (including XP, Vista, 7, and 8), Python comes as a self-installer MSI program filesimply double-click on its file icon, and answer Yes or Next at every prompt to perform a default install. The default install includes Pythons documentation set and support for tkinter
(Tkinter
in Python 2.X) GUIs, shelve databases, and the IDLE development GUI. Python 3.3 and 2.7 are normally installed in the directories C:\Python33 and C:\Python27 though this can be changed at install time.
For convenience, on Windows 7 and earlier Python shows up after the install in the Start button s All Programs menu (see ahead for Windows 8 notes). Pythons menu there has five entries that give quick access to common tasks: starting the IDLE user interface, reading module documentation, starting an interactive session, reading Pythons standard manuals, and uninstalling. Most of these options involve concepts explored in detail elsewhere in this text.
When installed on Windows, Python also automatically uses filename associations to register itself to be the program that opens Python files when their icons are clicked (a program launch technique described in ). It is also possible to build Python from its source code on Windows, but this is not commonly done so well skip the details here (see python.org).