Python, Unicode, Excel and Web Tesing

Peter Otten __peter__ at web.de
Fri Nov 7 09:25:38 CET 2003


calfdog at yahoo.com wrote:

[problems with excel automation, reportedly due to unicode]

(u'Test1',)

is a tuple, you are doing

(u'Test1',)[-1]

to extract the last item in that tuple, which is, by the way, the same as
the first item (u'Test1',)[0] in this case.

So you may still run into trouble when you inadvertently try to convert your
unicode string into a str *and* it contains characters with ord(c) >= 128.

However, rest assured that Python will spit out a helpful traceback :-)

Peter





More information about the Python-list mailing list