perl chomp equivalent in python?

a.c.a. serier a.serier at hccnet.nl
Wed Feb 9 16:59:02 EST 2000


Hello,

I have the following problem with lines read with readline.
How to remove the newline at the end?
Perl has chomp() to do this.
In this case use split to split up the line, but the last item has a
newline at the end.
I tried both split and replace(line, '\n', '') without result.
Can't find anything in tutorial, lib ref and FAQ.

Thank in advance,

Kees





More information about the Python-list mailing list