Coder/runner output is displaced right to left and work around

Hi experts, while working on the coder of an experiment in a computer in which I installed standalone psychopy v2021.2.4, I noticed that the output stream is dispalced right to left. The operating system of this computer is default to Hebrew (right to left). I reiterated the installation in another computer with similar default operating system (windows 10, 64bit) to the same end. In other computers in which the default operating system is left to right, there is no such problem. I found the work-around when I wished to demonstrate this problem to this forum: copy-paste into any document displays the wrong-displayed output log correctly! This is non-elegant work-around.
Is there a known fix to this issue? if not, I hope that this bug can be fixed in a next version soon.
Amnon

I’m somewhat confused about exactly what you mean by output stream. Please could you add some screenshots?

Hi,

Thanks for your question.

Please see the attached screenshot picture.

You can see the corrupted (right to left) output stream at the bottom wherein the code is correctly positioned at the upper part. As I mentioned, if I copy the corrupted text and paste it to document, email, it is displayed correctly.

Thanks,

Amnon

It looks as though most of your Windows is setup to be right-to-left, so this is most likely wx (the Python package the app is built using) misinterpreting the text in the output panel as being in a right-to-left language. Especially if the text can be copied and pasted in the correct order, that implies this is purely a display issue…

There’s a Python package called bidi which handles bi-directional text like this, we already import it as PsychoPy uses it for the :text: Text and :textbox: Textbox components, so it may be as simple as parsing code output before printing.

Hi Todd,
Thanks a lot for your response. Indeed, it is ourely a dosplay issue. Regarding printing - using the bidi is a good advice.
I understand that the bidi package is already embedded with the psyciopy code? (I am using V2022.1.2). The only place in which I have the right-to-left problem is in the output window of the coder and Stdout of the runner. Is there a way to enable the operation of the bidi package in displaying these outputs?

You’d need to edit the app’s code itself - which is difficult but doable.

It looks like you’re on Windows, so the app files will probably be in either:

C:\Program Files\PsychoPy

or

C:\Program Files x86\PsychoPy

If you can find it, go to:

[[path]]\Lib\site-packages\psychopy\app\coder

(where [[path]] is wherever the psychopy folder is)

and replace the file scriptOutput.py with this file:
scriptOutput.py (5.6 KB)

Hi Todd,
Thanks a lot!!!
I will replace the file as you have suggested.
Will let you know after I do that.
Best,
Amnon

Hi Todd,
I replaced the scripts but it did not fix the directional issue…
It is not critical, since, as I mentioned, I can copy-paste the missed-directional text into a file where it is correctly displayed, it is just unconvenient.
Anyway, thanks a lot!
Amnon