Python | os.ctermid() method
Last Updated :
22 May, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
os.ctermid()
method in Python is used to get the filename corresponding to the controlling terminal of the process.
Syntax: os.ctermid()
Parameter: Not required
Return Type: This method returns a string value denoting the filename corresponding to the controlling terminal of the process.
Code : Use of os.ctermid() method
import os
filename = os.ctermid()
print (filename)
|
Share your thoughts in the comments
Please Login to comment...