writelines() or write()

dave white dwhite2 at seas.upenn.edu
Fri Jun 23 16:27:58 EDT 2000


When I use writelines() and my strings have \r characters at the end
somehow my output file only contains the last line.  What's the correct
way to write multiple lines to a file?

strings = ['one \r', 'two \r', 'three \r}
outfile.writelines(strings)
---
outfile looks like this:
'three '
---
What I want to have happen of course is:
'one '
'two '
'three '

thanks,
david



More information about the Python-list mailing list