pty - Pseudo terminal utilities.
| Use Case | Command | Description |
|---|---|---|
| đĨī¸ Open a PTY pair | master_fd, slave_fd = pty.openpty() | Get master/slave file descriptors |
| đ´ Fork a child with a controlling terminal | pid, fd = pty.fork() | Child becomes session leader with a PTY |
| đ Spawn a process with PTY I/O | pty.spawn(argv) | Run a program, connecting its I/O to the PTY |
https://docs.python.org/3.10/library/pty.html
âšī¸ The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.
fork() â Fork and make the child a session leader with a controlling terminal. Returns (pid, master_fd).openpty() â Open a pty master/slave pair, using os.openpty() if possible. Returns (master_fd, slave_fd).spawn(argv, master_read=<function _read at 0x7fe9b6a98c10>, stdin_read=<function _read at 0x7fe9b6a98c10>) â Create a spawned process.__all__ = ['openpty', 'fork', 'spawn']
/usr/lib/python3.10/pty.py
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 11:08 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format