"\n" in ASCII-file

Gerhard Häring gh at ghaering.de
Fri Jul 18 13:59:08 CEST 2003


Gerhard Häring wrote:
> Most of the time, I want to strip any trailing whitespace and do 
> something like:
> 
> f = file("/path/to/my/file")
> for line in f:
>     line = line.strip()
>     # ...

s/strip/rstrip/g

-- Gerhard





More information about the Python-list mailing list