Custom Data Columns in .csv file

Hi, very new to PsychoPy and Python in general so please excuse any obvious mistakes.

I am using a list of images that are randomly selected. Two images are presented to the participant at a time and they must compare the two. I have my images divided into several categories, and have code that randomizes where the images appear (e.g. any “type” of image can appear on either side of the screen). I would like to be able to write data about which images were selected and where they were presented during the experiment into the .csv file that PsychoPy automatically generates after each experiment.

How do I do this?

In, say the “begin routine” tab of a code component, use this function:

thisExp.addData('a_csv_column_name', variable_to_save)

This works. Thank you so much!