This question already has an answer here:
- Paging output from python 4 answers
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?
You can use pydoc.pager for that. It's in the standard library.