如何在没有u''
包装器的情况下创建字符串?
我正在生成一些我想放入数组的字符串。
例如
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']