Python Introduction to pty Module

Python Introduction to pty Module

The full form of pty is Pseudo Terminal Utilities. The module is defined to handle Pseudo-terminal concepts. In this, we can start another process and also can write to and read from its controlling terminal using programs.
This module pseudo-terminal handling is highly platform-oriented. we should use code only for Linux to perform the operations.

In this article, We will be introducing the pty module.

The first step would be to import the pty module.  
cmd command:
import pty

Functions Defined in pty Module
Function Name : pty.fork() 
Description : Connect the child's controlling terminal to a pseudo-terminal

Function Name : pty.openpty() 
Description : Open a new pseudo-terminal pair

Function Name : pty.spawn() 
Description : connect its controlling terminal with current process standard io.

We will see details of these functions in upcoming Articles