Quick Reference from module doc strings.

Scott David Daniels Scott.Daniels at Acm.Org
Tue May 17 19:06:44 EDT 2005


Ron Adam wrote:

> ...What would be the advantage of using StringIO over list.append with 
> ''.join()?
The advantage is more in using a function that prints as it goes
rather than building up a large string to print.  I would call the
print function at the bottom (with None as the print destination),
rather than printing the result of calling the string function.

I just did the StringIO thing to show you that printing as you go
needn't mean you cannot get the string value without duplicating code.

--Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-list mailing list