'int' object has no attribute 'tStart'

PsychoPy version: v2021.2.3

Hi everyone!

Hello, I am new to Psychopy and I would really appreciate if you could help me.

I am trying to do a test similar to the Wisconsin test, 3 cards are presented and you have to match by color, if you make a proper match you will get a certain amount, but at the same time it will subtract from the maximum budget allocated.

Using Excel, I put the images to appear in a certain order, the amount to be given and the correct answer.

Conditions.xlsx (10.9 KB)

To do this, in code I put a counter to add the points, a correct and incorrect feedback or another variable from which the money will be subtracted.
But I get this error

thisComponent.tStart = None
AttributeError: ‘int’ object has no attribute 'tStart’

Begin experiment:
msg= ‘’
win= 0
money= 10000

Begin routine
if key_resp.corr:
msg = “Correct”
win= win + 2
money= money - 2
msg= “Incorrect”

End Routine

print (msg);
print (win);
print (money);

thisExp.addData(‘win’, win)

Hi @Maria_del_Carmen_Mor,

I think this is because you are using win as a variable name. win is the name given to the window in PsychoPy, and with this code you’re overwriting the window that PsychoPy has created to run your experiment in, with an integer.

Could you re-name the win variable to reward? Please make sure that you’ve replaced every instance of win in your code and then run the experiment again.



1 Like

Hi @Kimberley_Dundas

I really appreciate your help, the code already worked.

Again, thank you very much.

1 Like