Python os.forkpty() Method
Definition and Usage
The os.forkpty()
method forks a child process, using a new pseudo-terminal as the child's controlling terminal.
A Pseudo-terminal is a pair of pseudo-devices in which one is a slave connected to a program being run, most commonly a shell such as a bash and the other is a master is a terminal emulator which controls a slave such as xterm.
Note: Available on UNIX platforms only.
Syntax
os.forkpty()
Technical Details
Return Value: | A tuple value, representing pid (where
pid is 0 in the child and the new child's process id in the parent) and file descriptor |
---|---|
Python Version: | pre 2.6 |
Change Log: | 3.8: Calling forkpty() in a subinterpreter is no longer supported |