[SciPy-user] changing what is printed to the command prompt

Ryan Krauss ryanlists at gmail.com
Fri Nov 4 16:00:01 CST 2005


This is really more of a pure python question but here goes....

I have a user defined class and when I type the variable name at the
command prompt I get:

In [29]: temp
Out[29]: <rwkbode.bodeout instance at 0xb3e33e4c>

Can I define a method that would make this print something more
useful?  I guess I am really asking, is there a Python method that is
calls for each class when just the variable name is typed at the
command prompt.  I tried a __str__ method, but that didn't work.

Thanks,

Ryan



More information about the SciPy-user mailing list