Hello.
I am attempting to translate a completed PsychoPy experiment to PsychoJS. When ever I try to use a placeholder (%), the JS will clear and read appx. ‘fix python code’. I know that the Python code works because we have run the experiments. I am not sure what in the Python might be breaking the translation to JS, however. Here is the Python function:
def saveToLog(logString):
f = open(logFile, 'a')
f.write(logString)
f.write('\n')
f.close()
Here is how I use the function in the Python code:
saveToLog('experiment: %s' % expName)
saveToLog('researcher: %s' % (metaData['researcher']))
Each of the implementations above will break the translation to JS as soon as I type the second ‘%’, e.g.
...% expName)
I know that JS uses placeholders quite a lot. Does anyone know why this seemingly basic feature or use of the placeholder may not translate into PsychoJS?
Thank you for your help.