Use os.linesep instead of '\n'