On this page
posix.device_encoding
Prev: posix.ctermid | Up: posix | Next: posix.DirEntry
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.device_encoding
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import device_encoding
Signature & Overview
posix.device_encoding(fd)
Return a string describing the encoding of a terminal's file descriptor.
Usage
import os
enc = os.device_encoding(0)
assert enc is None or isinstance(enc, str)
Gotchas
- Returns
Nonewhen the fd is not connected to a TTY.
REPL Inspect
from posix import device_encoding
help(device_encoding)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/ctermid Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/DirEntry 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