Skip to main content

Introduction to Python Programming

Overview

Module description

This module will equip you with a working knowledge of the Python programming language as appropriate for a range of purposes within contemporary psychological science.

Indicative module syllabus

  • Introduction to Python via a graphical user interface
  • Plotting and data visualisation in Python
  • Flow of control 1: branching and loops
  • Flow of control 2: functions and structured programming
  • Logical variables and other data types
  • Debugging and error checking
  • Using Python extensions and libraries
  • Programming experiments with PsychoPy 1
  • Programming experiments with PsychoPy 2

Learning objectives

By the end of this module, you will have an operational knowledge of Python. You will be able to:

  • write simple Python programs and functions to perform routine tasks such as data analysis quickly and efficiently
  • discover and use special-purpose Python libraries for a wide variety of applications, including numerical tasks, deep learning and simulations
  • use Python libraries and add-ons (e.g. PsychoPy) to develop and run experiments, including stimulus presentation, recording of responses (and response time), trial randomisation, arbitrary block structure, and experiments that adapt online as the participant performs the task.