newbie question: if var1 == var2:

Kirk Strauser kirk at
Thu Dec 11 17:24:13 CET 2008

At 2008-11-29T04:02:11Z, Mel <mwilson at> writes:

> You could try
> for item in fname:
>     item = item.strip()

This is one case where I really miss Perl's "chomp" function.  It removes a
trailing newline and nothing else, so you don't have to worry about losing
leading or trailing spaces if those are important to you.
Kirk Strauser
The Day Companies

More information about the Python-list mailing list