| Reference | Downloads | Github

Syntax error in my experiment

Hi, I tried to run the psychopy 2 program, however, the folowing window appears:

Do you think that the reason is that I am using Russian language in my uploaded file?
Best regards,

No, I don’t think this is anything to do with the russian language. Do you have code components in your (psyexp) file. Could you upload a copy of it here? What version of psychopy are you using? At one point some code components were being corrupted by not having end-of-line characters recognised

1 Like

Hi @jon. Thank you for your reply. I have uploaded the copy of the code. the version installed in my laptop is: PsychoPy2 1.82.01. Experiment.psyexp (32.7 KB)

Could you update to the latest version (1.84.2) and try opening your study again? It opens fine on my computer although I can’t run it because it requires a cedrus button box, which I don’t have attached.

It looks as though wherever you have pasted your code from has included these arrows which seem to be interpreted as &#10 in the box above.

Hi @jon and @Oli. Thank you for your reply. Jon, regarding installing the latest version (1.84.2), I have did and the following windows appears:

So I stuck now, what should I do? I suspect the problem with the code that I am using. Jon can you send me another code that seems to be compatible with the latest version (1.84.2) please.
I am looking to hearing from you soon,
Best regards,

Hopefully I’m not further complicating things, but &#10 is html code for a line feed character (see here), and also, is the experiment file on a network drive? The path looks weird in the first email.

What I’m getting at is I wonder if this is an issue of something like Mac vs. Windows line endings?

Dear @daniel.riggs1, This code was first applied om MAC laptop. So I suspect that it generates some problems particularly &#10 when I want to use Windows laptop. Any suggestion if it is the case?

I am pretty sure &#10 also appears when opening psychopy code you wrote e.g. in version 1.84.2 in an older version of psychopy…i see it all the time.

So then if fadhel is able to upgrade successfully, hopefully this whole thing will go away, as Jon suggested.

Hi all @daniel.riggs1, @Yiannis, @Oli, @jon. After getting rid of &#10 in the code, the program runs normally today. Thank you for everyone who helped me by commenting on my post. Have a nice night for all of you.

Some extra info for the record:

  • @Oli Don’t worry about those arrows. That’s actually just a tab character which, although it isn’t recommended, is actually harmless as long as it isn’t mixed with spaces for indentation

  • the reason the &#10 character is there is that we convert to this on saving experiment files, and then undo that conversion when we reload the experiment, partly to avoid cross-platform problems in end-of-line characters. We only started doing this recently and I think Fadhel’s file was saved on a recent version of PsychoPy but then opened on an older version (that isn’t undoing the character conversion on load)

1 Like