On this page
  1. termios.tcgetwinsize
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

termios.tcgetwinsize

Prev: termios.tcgetattr | Up: termios | Next: termios.tcsendbreak
Rel: termios.error, termios.tcdrain, termios.tcflow, termios.tcflush
Ref: docs.python.org — termios.tcgetwinsize
Tags: #public #python3 #stdlib #termios


Import

import termios
from termios import tcgetwinsize

Signature & Overview

termios.tcgetwinsize(fd, /)

Get the tty winsize for file descriptor fd.

Usage

import termios

# Python 3.11+ Unix-only: returns (rows, cols) of a TTY fd
assert hasattr(termios, 'tcgetwinsize') or True

Gotchas

REPL Inspect

from termios import tcgetwinsize
help(tcgetwinsize)

Linked from

Related notes