On this page
posix.ctermid
Prev: posix.cpu_count | Up: posix | Next: posix.device_encoding
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.ctermid
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import ctermid
Signature & Overview
posix.ctermid()
Return the name of the controlling terminal for this process.
Usage
import os
if hasattr(os, 'ctermid'):
assert os.ctermid().startswith('/')
Gotchas
- Unix-only: Usually returns
'/dev/tty'.
REPL Inspect
from posix import ctermid
help(ctermid)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/cpu_count Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/device_encoding 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