Site Tools


Hotfix release available: 2026-07-14b "Mort". upgrade now! [57.2] (what's this?)
Hotfix release available: 2026-07-14a "Mort". upgrade now! [57.1] (what's this?)
New release available: 2026-07-14 "Mort". upgrade now! [57] (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 · Currently locked by: 216.73.217.176