At 2008-10-30T21:10:09Z, "Paulo J. Matos" <[EMAIL PROTECTED]> writes:

> Thanks for the tip but that has an issue when dealing with potentially
> millions of objects. You are creating a string in memory to then dump
> to a file [or screen] while you could dump to the file [or screen] as
> you go through the original string. Right?

How about:

def alternator(lst, sep):
    for index, item in enumerate(lst):
        if index:
            yield sep
        yield item

for item in alternator(list_of_objects, 10):
    print item,

-- 
Kirk Strauser
The Day Companies
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to