def open_delimited(filename, delimiter, chunksize=1024, *args, **kwargs):
    with open(filename, *args, **kwargs) as infile:
        remainder = ''
for chunk in iter(lambda : infile.read(chunksize), ''):
    pieces = re.split(delimiter, remainder + chunk)
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