0 Getting started: Introduction and installation guide

This book will teach you how to write Python programs that run on the command line. If you have never used the command line before, don’t worry! You can use programs like PyCharm (see figure 0.1) or Microsoft’s VS Code to help you write and run these programs. If you are completely new to programming or to the Python language, I will try to cover everything I think you’ll need to know, although you might find it useful to read another book first if you’ve never heard of things like variables and functions.

In this introduction, we’ll discuss

  • Why you should learn to write command-line programs
  • Tools and environments for writing code
  • How and why we test software

Writing command-line programs

Why do I want you to write command-line programs? For one, I think they strip a program down to its most bare essentials. We’re not going to try to write complicated programs like an interactive 3D game that requires lots of other software to work. The programs in this book will all work with the barest of inputs and create only text output. We’re going to focus on learning the core Python language and how to write and test programs.

Using test-driven development

Setting up your environment

Code examples

Getting the code

Installing modules

Code formatters

Code linters

How to start writing new programs

Why not Notebooks?

The scope of topics we’ll cover

Why not object-oriented programming?

A note about the lingo