psychopy.org | Reference | Downloads | Github

TypeError and Loop Error in building Attentional Blink Experiment

OS (Mac):
PsychoPy version (3.2.4):
**Standard Standalone? (y/)
**What are you trying to achieve?:

I am trying to build an ‘attentional blink’ experiment using a list of neural distractor words, and the a T1 (and T2 when I get to it), whereby I present say 12 distractors (neutral words), then a [neutral, positive or negative] word, then more (neutral) distractors, then a T2, being a colour word.

What did you try to make it work?:

Everything possible.

What specifically went wrong when you tried that?:

So I have been messing around with the coding component etc etc for hours now and now I have arrived here.

All I want to do is select one word from a conditions file (NeutralStim) (which is one column and a list of 26 neutral words). I have tried using the loop, and then on the selected rows input putting ‘randint(26)’ which I thought might just return a random row… but alas I get the following error message:

\\ File “/Users/darrenrhodes/Dropbox/NTU/Project Students 2019:20/Casey/EAB_lastrun.py”, line 310, in
trialList=data.importConditions(‘NeutralStim.xlsx’, selection=‘randint26)’),
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py”, line 375, in importConditions
for n in selection:
TypeError: ‘NoneType’ object is not iterable \\

I guess I am unsure about the TypeError, and what it actually means. If I put in a normal integer like ‘2’ then it works sort of fine.

I say, ‘sort of’, as it works for the first trial. I have some nested loops which tell the script how many distractors to first present which I have embedded in a code component for the first routine which presents distractors:

I set \\ myCount = 0 \\ in begin experiment

and then \\myCount = myCount + 1
if myCount > Tlocs:
trials.finished = True\\

in begin routine. Tlocs tells simply how many distractors to present.

It works for the first trial but in subsequent trials, there is just 1 single distractor presented, and then the single T1 stimulus. I guess this issue is maybe that the myCount does not reset to 0 ? I have tried putting \\myCount = 0\\ into the end routine, and the end experiment portions of that code component to no avail…

Sorry if this initial post is too long-winded. I think it’s probably best to understand the first issue before moving on to the second one I detailed.

Any help would be very welcome! (I have included the current builder scripts and xlsx files just in case).

Best wishes

Darren

TargetLocs.xlsx (8.4 KB) EAB.py (17.9 KB)

NeutralStim.xlsx (8.7 KB) Distractors.xlsx (9.2 KB)