What is the most efficient way to convert python codes to an experiment on pavlovia

URL of experiment:

Description of the problem:
Hello,
I have an experiment that is working on Psycopy, but I have only the python scripts.I want to upload it to Pavlovia. This is quite a complicated experiment, and so I prefer not to start building it from scratch on the builder. I am a bit confused from all the information online and I would like to understand what is the best approach.

Should I:

  1. First, convert my python scripts to JS scripts.
  2. then upload the JS scripts to the builder
  3. Finally, convert the JS files to a psychopy.exp file in the builder? is this stage can be done automatically?

Or, is there another, more efficient way to do it?

Thank you for the help!

A Builder .psyexp file is not code. It is simply a list of settings and values for stimuli and response components (stored in .xml format). Try opening one in a text editor and you’ll see what it contains. The only code in that file would be anything custom you provide in a code component, or code expressions you type into the settings of components.

Builder can then take all of those settings and generate from them Python or JavaScript (i.e. the code to run your experiment). That is a one-way process. You can take a list of stimulus settings and convert them to a program, because that is a deterministic process. You can’t go in the other direction (convert a script into a list of stimulus settings), because a hand-written program could be constructed in any number of ways. Builder could never be clever enough to work out how to reverse engineer the script into its .psyexp format.

So it doesn’t really make sense to talk of converting scripts (whether they are .py or .js) to Builder files.

Only if you are very good at both Python and JavaScript, and even then, we would advise you to use Builder instead, and just add custom code components as necessary.

No, as above, these steps don’t make sense.

It might take a couple of hours to get most of your experiment specified in Builder. It could take weeks or months to learn everything required to code it from scratch in a new language.