PyDocs

Nav

Generic Operating System Services

forkpty

os

functionUnixnot WASInot Androidnot iOS
  • forkpty()
Fork a new process with a new pseudo-terminal as controlling tty.

Returns a tuple of (pid, master_fd).
Like fork(), return pid of 0 to the child process,
and pid of child to the parent process.
To both, return fd of newly opened pseudo-terminal.
The master_fd is non-inheritable.
Changed in 3.8, 3.12, 3.15
  • 3.8: Calling forkpty() in a subinterpreter is no longer supported (RuntimeError is raised).
  • 3.12: If Python is able to detect that your process has multiple threads, this now raises a DeprecationWarning. See the longer explanation on os.fork().
  • 3.15: The returned file descriptor is now made non-inheritable.
0 Examples
No examples for os/forkpty.
See Also
No see-alsos for os/forkpty
0 Notes
No notes for forkpty