How to Use Python for Data Collection (e.g., in Psychology)

On this page, you will find all the data collection related tutorials on this site. That is, here you will find links to the post about creating psychology experiments in Python, scraping data with Python, among other useful tutorials related to these topics.

OpenSesame Tutorials

OpenSesame is easy to install and can be run under different operating systems such as Linux, OS-X, Windows, and Android. That is, you can run your experiments on tablets, phones, and computers.

OpenSesame experimental builder offers a graphical user interface (GUI) for creating simple experiments and more advanced experiments. This application requires minimal coding but let you write Python in-line scripts if needed

  • Save

There are two tutorials that focus on the same simple psychology task; the flanker task. However, these OpenSesame tutorials will also give you an overview of how to use the application. E.g., you will learn about the interface and how to use text and image stimuli:

PsychoPy is, as OpenSesame, a tool in which you can create computerized tasks (e.g., psychology experiments). The most recent version is based on Python 3 and it comes both with a drag-and-drop GUI and an IDE-like interface. That is, you can build experiments without knowing anything about coding and also use the PsychoPy API to program your tasks.

Information about PsychoPy (including links to some books) can be found in the post about Psychopy. Of course, the PsychoPy homepage will also contain a lot of useful information!

PsychoPy tutorials - Psychology experiments in Python
  • Save
PsychoPy Coder IDE

In the post, PsychoPy video tutorials, you will find a list of YouTube tutorials. Right now, some are these are focused on PsychPy2 but the post is updated frequently to provide a range of different how-tos focusing on creating experiments using PsychoPy.

Collecting Data in Python Tutorials - PsychoPy
  • Save
PsychoPy Builder View

If you are interested in seeing how a simple psychology experiment can be programmed using the PsychoPy API see the post about a sustained attention task in Python (PsychoPy). Note, however, that that post and the code for the task uses PsychoPy2.

Psychomotor vigilance task

In a more recent post, you can learn how to create a Psychomotor vigilance task with PsychoPy. If you just want to run the task, it is, of course, also possible to just download it.

Scraping Data using Python

In this section, you will find the links to Python tutorials focusing on collecting data by scraping the web. It could, for instance, be scraping scientific journal keywords, tables from Wikipedia, or tags from social medial. Note, right now there is only one tutorial available on this site:

Now, as with all these pages with Python tutorials, they will be updated when more how-tos and tutorials are added.

Scroll to Top
Share via
Copy link
Powered by Social Snap