User Tools

Site Tools


python_terminalsize

This is an old revision of the document!


Terminalgröße bestimmen

import shutil
shutil.get_terminal_size()

os.terminal_size(columns=160, lines=9)

The output that we see is a named tuple, so we can use it in multiple ways:

size = shutil.get_terminal_size()
size.columns

160

width, height = size
width

160

height

9

python_terminalsize.1717162411.txt.gz · Last modified: 2024/05/31 13:33 by walter