Timer 在精神病实验刺激中创建可视计时器

Timer 在精神病实验刺激中创建可视计时器,timer,psychopy,Timer,Psychopy,论坛新手,提前感谢您提供的任何帮助。 我有一系列的.jpg,当用户研究其中包含的信息时,它们会呈现给他们。说明中指出,每个jpg最多可研究120秒。我已经将其编码为jpg将在120秒限制后前进: RespKey= [] RT = [] event.clearEvents() myClock.reset() t1example = myClock.getTime() t2example = t1example while t2example

论坛新手,提前感谢您提供的任何帮助。 我有一系列的.jpg,当用户研究其中包含的信息时,它们会呈现给他们。说明中指出,每个jpg最多可研究120秒。我已经将其编码为jpg将在120秒限制后前进:

    RespKey= []
    RT = []
    event.clearEvents()
    myClock.reset()
    t1example = myClock.getTime()
    t2example = t1example
    while t2example < (t1example+120):    # value added to t1 here is timeout value; 
        RespKey = event.getKeys(keyList=["space"], timeStamped=myClock) # they are told to press space bar when done studying
        if len(RespKey) > 0:
            RT = RespKey[0][1]
            Resp =  RespKey[0][0].lower()
            print Resp
            print RT
            break
        else:
            t2study = myClock.getTime()      # end of timeout loop
    myWin.flip()
RespKey=[]
RT=[]
event.clearEvents()
myClock.reset()
t1example=myClock.getTime()
t2example=t1example
t2example<(t1example+120):#这里添加到t1的值是超时值;
RespKey=event.getKeys(keyList=[“space”],timestamp=myClock)#完成学习后,他们被告知按空格键
如果len(RespKey)>0:
RT=RespKey[0][1]
Resp=RespKey[0][0]。下()
打印响应
打印RT
打破
其他:
t2study=myClock.getTime()#超时循环结束
myWin.flip()
问题是,我不知道如何让用户在学习jpg时看到时钟/计时器/秒表功能。有没有一种方法可以将一个可见的时钟叠加到刺激上,这样在研究时间结束时就不会有人感到惊讶了

注意:新的编码,请在所有可能的情况下,用外行的术语

谢谢大家!

是的。在循环之前(以及重新设置时钟之前),创建如下文本刺激:

clockText = visual.TextStim(myWin) # include other parameters if you want to change the default size, font, etc
然后在每一帧上,你将更新刺激的内容。i、 e.在调用myWin.flip()之前,执行以下操作:

clockText.setText(str(t2study)) # you can format/round this as required
clockText.draw()

查看face_jpg.py编码器演示,了解在每一帧上显示这样的文本的示例

详细说明:您需要将myWin.flip()和Michael的代码放入循环中(缩进一步),以使其不断更新。