problem's with strings

Andreas Ulbrich ulbi at ivs.tu-berlin.de
Mon Nov 4 10:55:19 EST 2002


Richard Mertens wrote:
> first problem:
> 
> I'd like to convert a text-file von unix to windows and vice versa
> 
> Do you know a solution for this
> 
> 
> When the python script is reading the text-file i have always the Nextline - 
> Character on the end. How do you I remove it?

from windows to unix:
somestring.replace('\r', '')

vice versa:
somestring.replace('\n', '\r\n')





More information about the Python-list mailing list