[IPython-user] dir format

Tony Mannucci Tony.Mannucci at jpl.nasa.gov
Fri Dec 1 13:01:29 CST 2006


I have just started using ipython. I am very happy with it so far. 
It's an excellent piece of work.

A significant pet-peeve is the overriding of the python dir(). I use 
dir to see the attributes and classes in a module. For example:

import numpy as N

dir(N)

With python, I get a wide listing that can fit all the attributes on 
one screen. With ipython, each attribute is on a separate line and 
list scrolls off the screen. I cannot access all attributes (my 
screen buffer is not that large). Is there a variable setting to 
change the behavior of dir? Can I get the old dir back?

?N or ??N do not provide the same information as dir. Yes, it's more 
useful in a way, but sometimes I want to quickly find a function name 
without wading through the subpackages. Ultimately, the ipython 
method is better, but in some cases it's slower to use.

It's somewhat worse for pylab, as in:

import pylab as PLT

dir(PLT) scrolls off the screen.

?PLT provides no hint as to how to access the attributes. There are 
no subpackages. In this case, python's dir works better. I can see 
all the attributes in a little more than a screen. In ipython, many 
attributes have scrolled off.

Sorry to be such a newbie! Thanks for your help!

-Tony

-- 
Tony Mannucci
Supervisor, Ionospheric and Atmospheric Remote Sensing Group
  Mail-Stop 138-308,                     Tel > (818) 354-1699
  Jet Propulsion Laboratory,              Fax > (818) 393-5115
  California Institute of Technology,     Email > Tony.Mannucci at jpl.nasa.gov
  4800 Oak Grove Drive,                   http://genesis.jpl.nasa.gov
  Pasadena, CA 91109


More information about the IPython-user mailing list