这是一些代码......每当我得到一个输出文件时,我都会得到一倍的数据。
#For each record in keypress, a line is created in the file
keyPress = []
keyPress.append(event.waitKeys(keyList=['s','d'],timeStamped=clock))
for key in keyPress:
for l, t in key:
f.write(str(images[index]) + "\t iteration \t" + str(k + 1) + "\t" + l + "\t" + str(t)+"\n")
f.close()