On this page
posix.terminal_size
Prev: posix.statvfs_result | Up: posix | Next: posix.times_result
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org โ posix.terminal_size
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import terminal_size
Signature & Overview
posix.terminal_size(iterable=(), /)
A tuple of (columns, lines) for holding terminal window size
Methods & Attributes
terminal_size.count(self, value, /)โ Return number of occurrences of value.terminal_size.index(self, value, start=0, stop=9223372036854775807, /)โ Return first index of value.
Usage
import os, shutil
assert isinstance(shutil.get_terminal_size((80, 24)), os.terminal_size)
Gotchas
- Named tuple
(columns, lines).
REPL Inspect
from posix import terminal_size
help(terminal_size)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/statvfs_result Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/times_result Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chown shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chroot shared tags: #posix, #stdlib