Answer the question
In order to leave comments, you need to log in
How to display text in console size?
I output text to the console from a database in Python. Sometimes the text is very long and does not fit into the console window.
I want to do it like in man. That is, if you press the spacebar, the next page is shown, and if you press q, then the program ends.
I can't imagine how this can be done.
Answer the question
In order to leave comments, you need to log in
I think you can google about python pager
Or, for example, https://pypi.org/project/pager/
команда | less -R
well, or straight to make it very convenient
ls -la | vim -
where ls -la is your command
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question