Hi,

I am trying to check if a Unicode string matches data from an Easygui "enterbox". I spent one hour looking online how to solve this problem and I'm still stuck because I don't understand all of the explanations I find. Lots of trial and error didn't help either.

I use Python 2.5.1.

===This is the error message:===

UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal

I do understand that everything has to be in Unicode for my code to work, but I do not know how to properly change my code.

===This is my code:===

# coding: iso-8859-1

from easygui import *
import sys

good_answer = "pureté"  # notice the accute accent

answer_given = enterbox("Type your answer!\n\nHint: 'pureté'")

if answer_given == good_answer:
    msgbox("Correct! The answer is 'pureté'")
else:
    msgbox("Bug!")

Thank you in advance!

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to