newbie question: if var1 == var2:

Kirk Strauser kirk at daycos.com
Fri Dec 12 10:59:56 EST 2008


At 2008-12-12T15:35:11Z, "J. Cliff Dyer" <jcd at sdf.lonestar.org> writes:

> Python has a version equally good:
>
> def chomp(s):
>     return s.rstrip('\r\n')
>
> You'll hardly miss Perl at all. ;)

I haven't missed Perl in years!  I just wish there was a basestring.stripeol
method because I seem to end up writing the inline version of "chomp" every
time I iterate across a file.
-- 
Kirk Strauser
The Day Companies



More information about the Python-list mailing list