-5

If I want to display Unicode elements as string correctly, why should I do, in the English language?

hamed baziyad
  • 1,364
  • 3
  • 19
  • 31
  • 1
    Can you show me an example of what you mean? – Kent Shikama Dec 25 '17 at 08:30
  • Could you convert my_list from Unicode to string? my_list=[[u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'An efficient genetic algorithm for large-scale planning of dense and robust industrial wireless networks', u'Gong, X., Plets, D., Tanghe, E., (...), Martens, L., Joseph, W.'] – hamed baziyad Dec 25 '17 at 08:54
  • Possible duplicate of [convert selenium webelelements to list of strings in python](https://stackoverflow.com/questions/47959991/convert-selenium-webelelements-to-list-of-strings-in-python) – DebanjanB Dec 25 '17 at 09:23
  • @hamedbaziyad Can you show your code trials? How is it related to `Selenium`? – DebanjanB Dec 25 '17 at 09:24

1 Answers1

2

I suppose you can encode each item one by one into utf-8 if thats what you wanted.

list = [u"hi",u"Whatever",u"Hello"]
map(lambda item: item.encode("utf-8"), list)

Outputs

['hi', 'Whatever', 'Hello']

See the following for more details on the map function. You can also just use python3 if thats an option.

Kent Shikama
  • 3,316
  • 2
  • 16
  • 45