On Mon, Oct 7, 2013 at 9:40 PM, Siegfried Gonzi
<[email protected]> wrote:
> [I hope I am not screwing up the digest reply function here].
[You did, FYI. It happens...]
> I am after a "whos" which would work in a script. It is not very often that
> I develop code at the command line.
>
> I am definitely not one of the best programmers out there but I used "help"
> a lot in my IDL scripts and code. Our research group is migrating away from
> IDL towards Python.
>
> I think Python's help is not the same than IDL's help. I know copying things
> from other languages is not always a good idea but one cannot argue that
> IDL's help comes in rather handy while developing and testing code.
>From a script try:
print(repr(obj))
or
print(type(obj))
or if you always want just a 1 line summary:
def idl_help(obj):
if isinstance(obj, np.ndarray):
print("<ndarray with shape %s, dtype=%s>" % (obj.shape, obj.dtype))
else:
print(type(obj)
idl_help(obj)
(Customize to suit)
-n
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion