[Tutor] Pager in Python?

Lee Harr missive at hotmail.com
Mon Jul 25 21:40:32 CEST 2005

> > >Is there a command like more(1) or less(1) in python to display
> > >the output of a command (e.g. dir()) one page at a time?
> >
> >
> > How are you using dir() ?
> >
> > Is it in the "DOS Window" ?
> > One option would be to just get a better console.
>I am using Python 2.4 on RedHat Linux 8.0. In xterm window:{{{
>import os
>and the screen scrolls continuously.


Please stay on the list...

xterm is a pretty old console. Even so, you do have access to a
scroll buffer by pressing Shift-PageUp and Shift-PageDown. That
may be enough to do what you need to do. There are also some
command line switches for xterm to add scrollbars if you need.
I am not a big fan of xterm, though. I use konsole.

That said, I still think you may want to try ipython.

You might also be happy just using help(os) instead of dir(os)
The help screens feed through the pager, and you get more
info about what each thing is along with the names.

Don't just search. Find. Check out the new MSN Search! 

More information about the Tutor mailing list