Fix for python

Hi there!
I fixed the problem I had with the newlines being removed.
The other person did good to remove all new lines, but with this fix
it works even better. I did not remove anything, just made it even smarter :)

Greetings,
Alexander