Chapter 2. Getting started

 

This chapter covers

  • Installing Python
  • Using IDLE and the basic interactive mode
  • Writing a simple program
  • Using IDLE’s Python shell window

This chapter guides you through downloading, installing, and starting up Python and IDLE, an integrated development environment for Python. At this writing, Python 3.6 is the most current version, and 3.7 is under development. After years of refinement, Python 3 is the first version of the language that isn’t fully backward-compatible with earlier versions, so be sure to get a version of Python 3. It should be several years before another such dramatic change occurs, and any future enhancements will be developed with concern to avoid affecting an already-significant existing code base. Therefore, the material presented after this chapter isn’t likely to become dated any time soon.

2.1. Installing Python

Installing Python is a simple matter, regardless of which platform you’re using. The first step is to obtain a recent distribution for your machine; the most recent one can always be found at www.python.org. This book is based on Python 3.6. If you have Python 3.5 or even 3.7, that’s fine. In fact, you should have little trouble using most of this book with any version of Python 3.

2.2. Basic interactive mode and IDLE

2.3. Using IDLE’s Python shell window

2.4. Hello, world

2.5. Using the interactive prompt to explore Python

Summary

sitemap