textarea to list
textarea returns this
[u'a\r\nb\r\nc\r\nd\r\ne']
what is the be开发者_C百科st way to turn that into a list
['a', 'b', 'c', 'd', 'e']
Thanks!
>>> L = [u'a\r\nb\r\nc\r\nd\r\ne']
>>> L[0].split('\r\n')
[u'a', u'b', u'c', u'd', u'e']
txtarea = "Thank you for the music\nWelcome to the jungle"
x = txtarea.splitlines()
print(x)
精彩评论