newbie question: if var1 == var2:
MRAB
google at mrabarnett.plus.com
Fri Dec 12 11:47:43 EST 2008
Kirk Strauser wrote:
> 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.
>
Python is open source. You could suggest adding it and/or provide a patch.
More information about the Python-list
mailing list