> Agreed that > > line = line[:line.index('%')] > > is slightly more readable than > > line = line.split('%', 1)[0] How about: line = line.partition('%')[0] partition() works even if '%' isn't present. The index() and split() techniques raise exceptions if '%' isn't present. Malcolm