0

I wonder how to write a script with stdout like command-line like 'more', 'less', 'man' which it is seems they show their result in another layer of bash. how can I write a program with such output in python?

1 Answers1

0

You can use pydoc.pager for that. It's in the standard library.

from pydoc import pager
pager('hello world\n' * 100)
Håken Lid
  • 22,318
  • 9
  • 52
  • 67