@Yoriz, Doesn't
split()
remove '\n'? Isn't '\n' a whitespace?In [3]: import string In [4]: string.whitespace Out[4]: ' \t\n\r\x0b\x0c' In [5]: