I originally ran a PsychoPy script online via Pavlovia during COVID. Now, I am trying to adapt my script to be run locally–that is, I am converting my JS coding to Python.
In my original JS coding, I added some equations to calculate the approximate refresh rate of the participants monitors. However, when translating to Python, two problems emerge:
(1) The output to the first equation is incorrect, and
(2) The second equation yields this error code: TypeError: unsupported operand type(s) for /: ‘int’ and ‘NoneType’
Can anyone help out with this? The coding chunks are pasted below.
average_refresh_duration = (duration_clock.getTime()*1000)/frame_count
average_refresh_duration = thisExp.addData(‘average_refresh_duration’,average_refresh_duration)
approx_frame_rate = 1000/average_refresh_duration
approx_frame_rate = thisExp.addData(‘approx_frame_rate’, approx_frame_rate)