> in other words, "text" should probably be called 'text_bodies'. then
> you can do something like:
>
> logging.info("%s: %s" % ('Message bodies', ''.join('msg %d: %s; ' % x for x 
> in enumerate(text_bodies)))


in case it wasn't clear or seems to be obfuscated, here's a plain text
example of what the above does:

>>> a = ['foo', 'bar', 'google', 'app', 'engine']
>>> a
['foo', 'bar', 'google', 'app', 'engine']
>>>
>>> ''.join('msg %d: %s; ' % x for x in enumerate(a))
'msg 0: foo; msg 1: bar; msg 2: google; msg 3: app; msg 4: engine; '

here's a more Python-newbie-friendlier alternative:

>>> ':'.join(a)
'foo:bar:google:app:engine'

the point is that it is not a string, and you should use the str.join
() method to merge them together into a single string so that you can
successfully make the call to log it.

cheers,
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
   http://corepython.com

wesley.j.chun :: [email protected]
developer relations :: google app engine
-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to