Answers for "python get terminal height"

3

get terminal size python

import os

# you can do like this
columns, lines = os.get_terminal_size()

# or 
size = os.get_terminal_size()

columns = size.columns
lines = size.lines
Posted by: Guest on May-03-2021
1

python console width

import os
rows, columns = os.popen('stty size', 'r').read().split()
Posted by: Guest on September-01-2020

Code answers related to "python get terminal height"

Python Answers by Framework

Browse Popular Code Answers by Language