I am building a simple experiment in which a series of words are presented onscreen for 3 seconds each. I am implementing this in Builder, using a Text object to display the words.
I need the second letter of each word to be underlined. Note that I plan to use a list of words read from an excel sheet, but for the purposes of debugging I’m ignoring the excel sheet and just trying to present the word “hello”.
So far I’ve taken a unicode-based approach, for example:
This works in PsychoPy’s Coder View: see screenshot below
However when I use this code in the builder it fails. I have tried pasting
print('h\u0332ello') directly into the Text field of the Text object, which results in PsychoPy literally displaying “h\u0332ello” onscreen. I have also tried entering
$word into the text field, and then defining
word = print('h\u0332ello') in a code snippet. This latter approach causes the following error:
UnicodeEncodeError: 'charmap' codec can't encode character '\u0332' in position 3: character maps to <undefined>
Can anybody recommend a way to get this working?