Chapter 3. How You Run Programs
OK, it’s time to start running some code. Now that you have a handle on Python’s purpose and execution model, you’re finally ready to start some real Python programming.
There are multiple ways to tell Python to execute the code you type, and this chapter covers all the major program launching techniques in common use today. Along the way, you’ll learn both how to run code interactively, and how to save it in files to be run using a variety of techniques—with command lines, icon clicks, the IDLE GUI, mobile apps, web-based interfaces, module imports, and more.
As for the previous chapter, if you have prior programming experience and are anxious to start digging into Python itself, you may want to skim this chapter and move on to Chapter 4. But don’t skip this chapter’s early coverage of preliminaries and conventions, its overview of debugging techniques, or its first look at module imports—a topic essential to understanding Python’s program architecture, which we won’t revisit until Part V. It’s also worthwhile to browse the sections on IDEs and apps, to sample tools that may be more useful once you start coding larger programs.
Installing Python
This book will generally assume that you have access to a recent version of Python on your computer, tablet, or phone. Python installation is not required for this book, and isn’t necessary in some contexts, but you’ll need a Python to work along with examples and do end-of-part exercises, and both are ...