# -*- coding: utf-8 -*-Or could you (as always) provide the actual error rather than saying "it won't work". PsychoPy can definitely present unicode characters as text stimuli.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/fc340e78-955b-4cf8-a806-69e17cd1b57f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
chymera@desktophost ~/src/faceRT $ python "start.py"
/usr/lib64/python2.7/site-packages/psychopy/gui.py:45: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
app = wx.PySimpleApp()
moved pre-existing data file /home/chymera/src/faceRT/results/chr.csv to backup location (/home/chymera/src/faceRT/results/.backup/chr_2013-08-20_171316.csv)
Traceback (most recent call last):
File "start.py", line 52, in <module>
em_faces(win, expInfo, fixation, fixationtime, trialClock, local_dir)
File "/home/chymera/src/faceRT/experiments.py", line 43, in em_faces
\n\nFortfahren mit beliebiger Taste.',wrapWidth=20.0)
File "/usr/lib64/python2.7/site-packages/psychopy/visual.py", line 4317, in __init__
self.setText(text, log=False) #self.width and self.height get set with text and calcSizeRednered is called
File "/usr/lib64/python2.7/site-packages/psychopy/visual.py", line 4399, in setText
self.text = unicode(text)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
6.0520 WARNING User requested fullscreen with size [1920 1080], but screen is actually [2048, 1152]. Using actual size
AL lib: (EE) alc_cleanup: 1 device not closedchymera@desktophost ~/src/faceRT $ python "start.py"
Traceback (most recent call last):
File "start.py", line 7, in <module>
from experiments import em_faces
File "/home/chymera/src/faceRT/experiments.py", line 39
SyntaxError: Non-ASCII character '\xc3' in file /home/chymera/src/faceRT/experiments.py on line 39, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details Fortfahren mit beliebiger Taste."
doesn't start with a u. Sorry, I know this is a pain, but it's a
historical part of Python itself and I can't make it go away! ;-)To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/eb23fd91-5a68-450b-8887-0f4c52ef2460%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hello,
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/f523b6ee-a878-4b47-b0b0-2c14c5fc8048%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
import sys
reload(sys)
sys.setdefaultencoding('utf8')...You need both the encoding thing at the top of the file (or you get the lower error) and you have to specify each string in your script as being u (or you get the upper error).
On 20/08/2013 16:17, Horea Christian wrote:
Sure, I added the UTF line to both start.py and experiments.py now (new code as seen here). The exact error output is: