[Python-Dev] Pre-PEP Idea

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Sat, 15 Jul 2000 22:41:13 +0300 (IDT)


On Sat, 15 Jul 2000, Paul Prescod wrote:

> Good idea. And eventually some way for extensions to register
> themselves...and a pager. Do we have pager code hanging around? Some
> docstrings are already long and we have no mechanism for breaking them
> up ....

Do you mean this:

import sys

def pager(lines, length=23):
        while lines:
                sys.stdout.writelines(lines[:length])
                lines = lines[length:]
                if lines:
                        raw_input("--more--")

def main():
        pager(open(sys.argv[1]).readlines())

if __name__ == '__main__':
        main()

--
Moshe Zadka <moshez@math.huji.ac.il>
There is no GOD but Python, and HTTP is its prophet.
http://advogato.org/person/moshez