How can a string be created without u'' wrapper?
I’m generating some string that I’d like to put into the array.
E.g.
STR = ""
for i in some_array:
STR += '\'\t<img src="media/'+i+'" alt="" />\n,\' '
arr = ['i"m', 'the', 'array', STR, 'end']
# The result is:
# arr = ['i"m', 'the', 'array', u'\'\t<img src="media/1.jpg" alt="" />\n\', \'\t<img src="media/2.jpg" alt="" />\n\' ', 'end']
# i'd like to have it like:
# arr = ['i"m', 'the', 'array', '\t<img src="media/1.jpg" alt="" />\n', '\t<img src="media/2.jpg" alt="" />\n', 'end']
That wrapper is just something indicating in the interactive Python console that it’s a
unicodestring. If you print it out or put it in a template (e.g. withprint(' '.join(arr))), theu""won’t show up.