python - How to convert list to unicode list -


i have following list example

['justice league', 'avenger'] 

now problem facing convert list unicode list
unicode list example

[u'justice league', u'avenger'] 

how can achieve this? thank response.

try applying unicode elements

>>> lst=['justice league', 'avenger'] >>> map(unicode,lst) [u'justice league', u'avenger'] 

obviously talking python 2 only, since literal strings unicode default in python 3

have @ this q&a on same subject


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -