psychopy.org | Reference | Downloads | Github

Production of .py incorrect in psychopy v2021.1.4

Hi

I noticed that psychopy v2021.1.4 does not produce the .py files properly when a routine has a Code Type “JS” with some code that looks like:
whitebg=new util.Color([1,1,1]);
win.color=new util.Color([1,1,1]);

The python file generated has code that looks like:
:

Initialize components for Routine “start_3”

start_3Clock = core.Clock()
event=psychoJS.eventManager;
thisExp=psychoJS.experiment;
win=psychoJS.window;
win.winType=‘pygame’;
shuffle = util.shuffle;
win.blendMode=‘avg’;
win.color=new util.Color([1,1,1]);

This is clearly incorrect since the python file should not contain anything from the “JS” code type that isn’t converted properly in python syntax.

I suspect that the problem may also exist in the creation of .js version of the file.

The outcome is that the file does not run online properly and is stuck in “initializing the experiment” when the python versions of the file is basic.

Older version of the experiments using older versions of psychopy and python are ok with the same code since the auto-conversion into python and js files is correctly done. Has the Javascript cribsheet/rules for the newest version of standalone psychopy changed?

This is the version of psychopy that I am on currently:

thanks

Ah, yes!

1 Like