How to split a string on newlines in python?