"\n" in ASCII-file

Gerhard Häring gh at ghaering.de
Fri Jul 18 07:59:08 EDT 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