S
S
Sergey Karbivnichy2021-10-26 16:58:36
Python
Sergey Karbivnichy, 2021-10-26 16:58:36

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

2 answer(s)
A
Alexey Kharchenko, 2021-10-26
@hottabxp

I think you can google about python pager
Or, for example, https://pypi.org/project/pager/

V
Viktor Taran, 2021-10-26
@shambler81

команда | 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 question

Ask a Question

731 491 924 answers to any question