[Tutor] Problem with input() and unicode string

Alex abccbg at yahoo.co.uk
Wed Jul 28 18:05:01 CEST 2010


Hello, I have a problem with this code:

# -*- coding: latin-1 -*-
year = u'año, ò, ó, ç'
print year
year = input(u'Introduce el año:')
print year
raw_input()

The first print statement works as expected, both in IDLE and when 
double-clicking the file for a console view.
The second one works in IDLE, but just flashes by when double-clicking the file, 
due to an error report I can't see. 

I believe the problem is that input prompt doesn't support unicode strings, 
which means I can't use my language for prompts?
Could someone please tell me how to fix it or provide a workaround?
Thanx.

Using Python 2.7 under win32.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100728/81011da1/attachment.html>


More information about the Tutor mailing list