#object: 呈现一个量表的打分条 #writer: mike #time: 2020.09.15 from psychopy import visual,core MyWindown = visual.Window([800,600], screen=0, fullscr=False) #文本刺激 Text = visual.TextStim(win = MyWindown, text = u"hsdasadd",units= 'pix',pos=(0,100)) #评价条刺激 Rating =visual.RatingScale(win = MyWindown,scale="very happy ------------very unhappy", low=1, high=10,precision=1,pos=(0,-0.1),showValue=True, marker='cirle') #呈现刺激,不断的刷新屏幕 while Rating.noResponse: Rating.draw() Text.draw() MyWindown.flip() #如果被试确定了刺激,就进行下一个画面 Text1 = visual.TextStim(win = MyWindown, text = u"congradulations",units= 'pix',pos=(0,100)) Text1.draw() MyWindown.flip() core.wait(5) MyWindown.close()
其中最关键的一步,是 while循环,如果没有while循环,那么,用鼠标点击评分条,会没有效果。