new line

Kuljo kuljo at freemail.hu
Mon Aug 29 20:56:43 EDT 2005


Kuljo wrote:

> 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


I have found this in the meantime:

>>>nl="\\"+"n"
>>>text_new=replace(text_old, chr(10), nl)

It works.



More information about the Python-list mailing list