Setting Up a Development Environment

What You Will Learn

  • An IDE is a sophisticated text editor that allows you edit, run, and debug code.

  • The Python shell is an interface for typing Python code and executing it directly in your computer’s terminal.

  • The IPython shell is a much nicer version of the Python shell - it provides syntax highlighting, autocompletion, and other features.

  • The Jupyter Notebook is a powerful tool for prototyping and experimenting with code, as well as visualizing data and writing nicely-formatted text. We will be using this throughout the course.

Integrated Development Environments

In Section 1 of this module, we learned that a Python script is simply a text file that contains Python code. Aside from using a .py suffix for the filename, there is nothing that differentiates this sort of file from any other text file. That being said, it is not a good idea to use a simple text editor to write Python code (and it is a big mistake use word-processing software, like Microsoft Word, to do so). Instead we want an “integrated development environment” (IDE) that will facilitate our code-writing.

First and foremost, a good IDE will provide a text editor that will:

  • check your code for syntax errors (a misspelled function name, a reference to an undefined variable, etc)

  • colorize your code so that it is easy to distinguish, for instance, numbers from character strings.

  • enable you to easily look up documentation and definitions for functions that you are using.

  • autocomplete the names of variables and functions as you are typing them.

An IDE also often provides debugging tools so that you can test your code; it will also typically interface with version-control software, like Git, so that you can keep track of versions of your code as you modify it. We will not discuss these useful, but more advanced features here.