Sticktime Publishing

The Python Book

Before We Get Started

The following directions are optional but very highly recommended. If you haven’t installed Python yet you should really go to ActiveState ( and find their free Python distribution for your operating system. The ActiveState Community Edition distribution, as stated, is absolutely free and comes with all kinds of OS-specific settings, utilities and other goodies. The Windows distro has more than a couple graphical user interface (GUI) frameworks and other tools for scripting the OS. Once you’ve installed your new ActiveState Python installation, make sure that it works and then head on over to IPython ( and install their addon which will add a lot of useful functionality to the system.

I need to emphasize that if you can’t run the ActiveState version of Python, or if you can’t install IPython, don’t lose heart, you can still follow along with a lot of the material here. ActiveState Python and IPython are really nice to have but not strictly necessary.

Who This Book Is For

This book will only cover the features of programming languages peculiar to the Python programming language, so it will be helpful to know something about the basics of programming. While this book will cover everything the beginner to Python needs to know, those completely new to programming will want to read this text’s sister volume, the Programming Fundamentals Book, either as a prerequisite to or along with this book. Definitely should you encounter any term or concept that you don’t understand, consult that book, which I hope you will find as fun and easy to read as this guide.

Who This Book Is Not For

One has to walk before they can expect to be able to run. Anyone can learn Python who first has a very firm grasp on the fundamentals of computing and secondly has a solid understanding of the basics of programming and programming languages. If you find yourself getting lost in the explanations here, it surely means that you need to go back and learn from the aforementioned resources. While we do delve into the subject matter and examples quickly, learning anything new, much less attaining virtuosity, takes patience.

Getting Started

Instead of putting you to sleep with an extended evangelical essay about why you should prefer Python, we will go over a quick list advantages to using Python over other programming languages now and jump into feature explanations and examples as we go along, covering the related material.

Some aspects of Python that make it a superior language include:

This list is not exhaustive.

The Interactive Command Line

Instead of running Python, we will be using the IPython enhanced command line interface:

iPython screen

Upon running iPython you will see a few lines explaining what versions of Python and IPython you have installed.