So, you want to learn programming. Welcome to one of the great adventures of the twenty-first century. Programming requires little in the way of specialized equipment; the software tools can all be downloaded for free off the Internet, and it can be practiced in the safety and comfort of your own home, without having to ask anyone’s permission. This chapter will ease you in gently by introducing you to the software you will need to create your programs: a command-line interface, which allows you to use Python in interactive mode, and a text editor for writing scripts—nothing more complicated than that. I will also show you where to go to find help and documentation, so you can decode the sometimes- impenetrable jargon that seems to surround this, the geekiest of all technical disciplines. To begin with, you will need to make sure that you have a decently recent version of Python installed on your machine or follow the steps later in this chapter to install it (see “Choosing the Right Python Version” for a definition of decently recent). This chapter explains how to make sure that you have everything set up correctly and that you have suitable references at hand before you start your journey.
Python is an excellent language with which to learn programming. There are many reasons for this, but the simple explanation is that it’s easy to read and fast to write; it doesn’t take long to come up with working code that does something meaningful. Python has a very human-friendly syntax, which makes writing elegant code easy. The basic language is fairly simple and therefore easy to remember, and then it has an extensive library of predefined functions that you can use to facilitate most common computer tasks. Writing effective applications in Python can be as simple as playing with conceptual building blocks. It works really well for writing a little two-line application to perform some routine system administration task or to provide interactive functions on a web page, but it has enough power and flexibility to comfortably create much larger and more complex applications with graphic interfaces indistinguishable from the programs you are used to running from your computer’s main menu. If you follow the suggestions laid out in this book about writing self-explanatory code, in several months, even years, you will be able to come back to your programs and see immediately what they were supposed to do and what your original intentions were; this makes maintaining programs much simpler too.
OK, let’s make sure your system is ready for you to start running Python programs.