splitlines

>>> a = "hello\nhow are you\ni am fine"
>>> print a
hello
how are you
i am fine
>>> b = a.splitlines()
>>> print b
['hello', 'how are you', ' i am fine']

原文地址:https://www.cnblogs.com/seasonsstory/p/3133983.html