Opens textfile in skipped routine


I am skipping some of the routines or components in psychopy. For example, I can have two components, decision and outcome, and for each I am reading in a .csv file. However, in some trials I only want to show the decision component, but not the outcome routine. For this, I created an index that either skips (ContinueRoutine = False) or enters the component. Even though on trials where it skips the routine, it still reads in the textfile and thereby writes 1-2 lines into the saved .csv file. I don’t know how to avoid this, because it creates a super messy final textfile.

Any ideas?

To skip a routine you need to put continueRoutine = False in Begin Routine.

To skip a loop you need to set the nReps to 0 using a variable.

It sounds like you are running the loop but skipping the routine within it, which would result in blank lines in the data file.