Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
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: by walter