if you add a __str__() method to the class that returns a string you
want to print instead of the default handle number

class Rep(object):
    def __init__(self):
        self.sint = 5
        # some other init stuff
        pass
    def __str__(self):
        return "<Rep: sint=%d>" % self.sint

Maybe adding a __repr__(self) method would be needed (if you use %r in
your print strings)


2010/11/14 Zeynel <[email protected]>:
> On Nov 13, 7:10 am, Wim den Ouden <[email protected]> wrote:
>> why not simple results_type = results
>
> Yes, thanks, this
>
>    self.response.out.write("C_RESULT: %s " %
> (C_RESULT))
>
> returns
>
>    C_RESULT: [<__main__.Rep object at 0x044F0630>]
>
> Is there a way to print the contents of this object without iterating?
>
> --
> 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.
>
>

-- 
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