osdir.com


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

Unicode and Python - how often do you index strings?


Johannes Bauer <dfnsonfsduifb at gmx.de> writes:
> line = line[:-1]
> Which truncates the trailing "\n" of a textfile line.

use line.rstrip() for that.