Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
So how do I avoid this? I need to have multiple lines in my file, and this only happens on the first line. How could I fix this?

I don't know, strip the new line manually? Perhaps there is a more sensible way of solving it with Python, look at the docs.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.