new line

Claudio Grondi claudio.grondi at freenet.de
Mon Aug 29 18:30:13 EDT 2005


"Kuljo" <kuljo at freemail.hu> schrieb im Newsbeitrag
news:K1KQe.28113$hV3.11465 at nntpserver.swip.net...
> Dear friends
> I'm so sorry to bore you with this trivial problem. Allthou: I have string
> having 0x0a as new line, but I should have \n instead.
> How should I solve it?
> I've tried
> >>>text_new=tex_old.replace(str(0x0a), '\n')
> and other things, but none of them worked.
> Thanks in advance

text_new=tex_old.replace(chr(0x0a), '\r\n')
works for me.

Claudio
P.S. str(0x0a) == '10'





More information about the Python-list mailing list