Converting python commands to javascript

Hi,

I am trying to convert python to javascript so I can make my experiment online. I have a code component, but unsure how to translate it…can anyone help?

Hi @JubedaB, take a look at the latest version of PsychoPy - it has built-in Python to JavaScript auto-translate in the code components.

Thank you, I have done that.

I now just need a code to define sequence, not sure how to do that…

Hi @dvbridges,

I would love to use the auto translate feature but I can’t find it anywhere. My version of Psychopy is 3.2.4. could you give a bit more info as to how this can be used.

Thanks!

Hi @Brennan, you need PsychoPy version 2020.1. If you use the standalone version, then the code components will default to auto-translate. In a code component, you will type in your Python code in the left panel, and it will translate real-time into JS in the right panel.

Did I miss some steps? Cause there was nothing in my right panel. Python code didn’t translate into JS

You need to work in Builder not Coder. Have a look at the quick start guide (see pinned post in online)