The usual idiom for this is: l = [] p = l.append p('foo') p('bar') thing = string.join(l, '\n') Florent Christopher N. Deckard <cnd@ecn.purdue.edu> wrote:
Is it possible to do something like this:
print 'foo' print 'more foo' print 'I like foo'
thing = printed printed = ''
print 'bar' print 'more bar'
otherthing = printed
I want to do this because I want the new line at the end of each line and don't want to put "\n"'s everywhere. Is it possible to do that? Or am I just insane. Zope tells me that 'printed' is a reserved word.
Thanks, -Chris
-- -------------------------------------------------------------------- Christopher N. Deckard | Lead Web Systems Developer cnd@ecn.purdue.edu | Engineering Computer Network http://www.ecn.purdue.edu/ | Purdue University ---- zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') ---
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 10 http://nuxeo.com mailto:fg@nuxeo.com