Dark theme

Intro to running Python


In this session, we're going to look at five different ways of developing and running Python. These are:

  1. running single text files ("scripts") at the command line;
  2. running one command at a time inside a REPL shell;
  3. combining scripting with REPL with IDLE;
  4. combining scripting with REPL in Spyder;
  5. combining REPL and other text in Jupyter/iPython Notebooks.
Although this sounds like a lot of ways of running something, as we'll see, this sequence will slowly build the sophistication of the environments. There are other ways of running Python (for example, as a scripting language inside another application like ArcGIS or QGIS), but most Python code is run in one of these ways, so it helps to get familiar with them early.

In addition to seeing how to run Python, we'll also start to look at debugging – sorting out issues with our code. The software we use to run the code will help us with this.


Work through the pages below to get an intro to running Python. Instructions are in bold like this paragraph.

  1. This page
  2. Get the software <-- next
  3. Writing our first program: running at the command line
  4. Debugging
  5. IDEs: IDLE and Spyder
  6. Jupyter Notebook