osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unicode and Python - how often do you index strings?


2014-06-05 13:42 GMT-05:00 Johannes Bauer <dfnsonfsduifb at gmx.de>:

> On 05.06.2014 20:16, Paul Rubin wrote:
> > Johannes Bauer <dfnsonfsduifb at gmx.de> writes:
> >> line = line[:-1]
> >> Which truncates the trailing "\n" of a textfile line.
> >
> > use line.rstrip() for that.
>
> rstrip has different functionality than what I'm doing.


How so? I was using line=line[:-1] for removing the trailing newline, and
just replaced it with rstrip('\n'). What are you doing differently?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140605/d6aed2e0/attachment.html>