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

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


Thanks Fernando.

On 11/4/05, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> Ryan Krauss wrote:
> > 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.
>
> __repr__
>
> Cheers,
>
> f
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>



More information about the SciPy-user mailing list