Wiley Python: Create - Modify - Reuse 978-0-470-25932-0 User Manual
Product codes
978-0-470-25932-0
A Python Primer
This chapter provides a quick overview of the Python language. The goal in this chapter is not to
teach you the Python language — excellent books have been written on that subject, such as
Beginning Python (Wrox, 2005). This chapter describes Python ’ s lexical structure and programming
conventions, so if you are familiar with other scripting languages such as Perl or Ruby, or with
compiled programming languages such as Java or C#, you should easily be up to speed in no time.
teach you the Python language — excellent books have been written on that subject, such as
Beginning Python (Wrox, 2005). This chapter describes Python ’ s lexical structure and programming
conventions, so if you are familiar with other scripting languages such as Perl or Ruby, or with
compiled programming languages such as Java or C#, you should easily be up to speed in no time.
Getting Star ted
Of course, the first thing you need to do is install Python, if you don ’ t already have it. Installers are
available for Windows, Macintosh, Linux, Unix, and everything from OpenVMS to the Playstation
(no, I ’ m not kidding).
available for Windows, Macintosh, Linux, Unix, and everything from OpenVMS to the Playstation
(no, I ’ m not kidding).
Obtaining Python and Installing It
If you go to
www.python.org/download
you can find links to download the correct version of
Python for your operating system. Follow the install instructions for your particular Python
distribution — instructions can vary significantly depending on what operating system you ’ re
installing to.
distribution — instructions can vary significantly depending on what operating system you ’ re
installing to.
What Version Number to Install
Although the examples in this book should work for any Python version above 2.0, it is
best to install the latest stable build for your operating system. For Windows (which is
the environment I primarily work in), the latest stable version is 2.51. There is an alpha
build of Python 3.0 available as of this writing, but other than just looking at it for fun,
I ’ d steer clear of it for the examples in this book — in some cases the syntax is very
different, and the examples in this book won ’ t work with Python 3.0.
best to install the latest stable build for your operating system. For Windows (which is
the environment I primarily work in), the latest stable version is 2.51. There is an alpha
build of Python 3.0 available as of this writing, but other than just looking at it for fun,
I ’ d steer clear of it for the examples in this book — in some cases the syntax is very
different, and the examples in this book won ’ t work with Python 3.0.
c01.indd 1
c01.indd 1
6/2/08 12:03:06 PM
6/2/08 12:03:06 PM
COPYRIGHTED MATERIAL