K
K
Konstantin Kandaurov2014-12-19 07:02:50
Python
Konstantin Kandaurov, 2014-12-19 07:02:50

How to convert a list of tuples to unicode?

There is a list of tuples lettre = (("word1", number_of_text), ("word2", number_of_text), ("word3", number_of_text) ... )

txtout = u"Самое часто встречающееся слово в тексте: " + unicode(lettre[0][0], "UTF-8")

This line gives an error "TypeError: decoding Unicode is not supported"
How to get out of the situation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2014-12-19
@mututunus

Judging by the error, lettre[0][0] is already in unicode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question