string encoding problem

Martin v. Loewis martin at v.loewis.de
Wed Nov 20 17:58:49 EST 2002


Rodolphe <robloche at fr.st> writes:

> Could someone help me out with this simple problem ?

Tk is returning a Unicode object to you. If you want to write that
Unicode object to a byte stream, you need to encode it, e.g. with

  print str.encode("cp1252")

Regards,
Martin




More information about the Python-list mailing list