0

Based on the height of the current terminal window, I want to determine how many lines I can display and display the rest of the lines in a different screen, once enter is pressed. I know how to do it in Perl, I want to know how to do it in python. Is there any library I'm missing?

**edit : ** I have the size of the terminal. Let's say its height is 80 characters. I want to know how can I modify the display of the output of say 200 lines, to say 50 at a time.

  • 2
    Does this answer your question? [How to get Linux console window width in Python](https://stackoverflow.com/questions/566746/how-to-get-linux-console-window-width-in-python) ... `shutil.get_terminal_size()` or `ioctl()` would be my preferred method, over `os.popen('stty size', 'r')` – Attie Apr 02 '20 at 15:17
  • No. I have the size of the terminal. Let's say its height is 80 characters. I want to know how can I modify the display of the output of say 200 lines, to say 50 at a time. – Annie Chakraborty Apr 02 '20 at 15:21
  • If you're asking "_How do I determine the number of rows **and** how do I only print N lines, waiting for before showing the next page_", then please revise your question and title. Make the second part the focus of your question. – Attie Apr 02 '20 at 15:23

0 Answers0