How do i get the number of cycles。For example, if a loop is run three times, how do I get the attributes of the loop

how do i get the number of cycles。For example, if a loop is run three times, how do I get the attributes of the loop。

if expInfo[“group”] == “A” and trials_2.thisRepN==1:
t1 = 1
t2 = 0
t3 = 0

ThisRepN attribute indicates the number of cycles

See the API documentation here:

https://psychopy.org/api/data.html#psychopy.data.TrialHandler

which distinguishes the loop properties .thisN, .thisRepN, .thisTrialN

Otherwise it’s not entirely clear what your question is?

1 Like