> I would've thought that the 'b' option meant I can write any binary
> code I like to the file,
> but that's not so?
You can. But if you write a unicode-object (wich is an abstract data
type with no byte representation), it has to be converted to a string -
which you have to do either explicit. Or if you don't do it - it ill be
done automatically, using the system default encoding. Which is ascii,
most of the time.
So do
noteFileObj.write(note.encode("utf-8"))
Regards,
Diez
--
http://mail.python.org/mailman/listinfo/python-list