pydoc > pty

📛 NAME

pty - Pseudo terminal utilities.

🚀 Quick Reference

💼 Use Case⚙️ Command📝 Description
Acquire a PTY pairpty.openpty()Returns (master_fd, slave_fd) — two file descriptors for the master and slave sides of a new pseudo-terminal.
Fork with controlling terminalpty.fork()Returns (pid, master_fd) — forks a child process that becomes a session leader with the new terminal as its controlling terminal.
Spawn a process in a PTYpty.spawn(['/bin/bash'])Creates a new process connected to a pseudo-terminal; the child's standard I/O is tied to the terminal, and the parent reads/writes through the master fd. Blocks until the child exits.

📚 MODULE REFERENCE

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.

🔧 FUNCTIONS

📦 DATA

__all__ = ['openpty', 'fork', 'spawn']

📁 FILE

/usr/lib/python3.10/pty.py
pty
📛 NAME 🚀 Quick Reference 📚 MODULE REFERENCE 🔧 FUNCTIONS 📦 DATA 📁 FILE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-01 16:53 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!