for piece in pieces[:-1]:
    yield piece
remainder = pieces[-1]
if remainder:
    yield remainder
for line in open_delimited('log.txt', delimiter='/'):
    pass
Change delimiter on "for each" loops on Strings in python