# pydoc > pty

---
type: CommandReference
command: pty
mode: pydoc
section: 
source: pydoc3
---
## Quick Reference
- `pty.fork()` — fork and make child a session leader with controlling terminal, returns (pid, master_fd)
- `pty.openpty()` — open pty master/slave pair, returns (master_fd, slave_fd)
- `pty.spawn(argv)` — create a spawned process

## Name
Pseudo terminal utilities.

## Synopsis
`import pty` — module for pseudo-terminal handling.

## Functions
- `fork()` — Fork and make the child a session leader with a controlling terminal, returning (pid, master_fd).
- `openpty()` — Open a pty master/slave pair, using `os.openpty()` if possible, returning (master_fd, slave_fd).
- `spawn(argv, ...)` — Create a spawned process. (The exact signature is not provided in the source.)

## See Also
- [pty module documentation](https://docs.python.org/3.10/library/pty.html)
- [os.openpty](https://docs.python.org/3.10/library/os.html#os.openpty)