SkillAgentSearch skills...

Ptyprocess

Run a subprocess in a pseudo terminal

Install / Use

/learn @pexpect/Ptyprocess
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Launch a subprocess in a pseudo terminal (pty), and interact with both the process and its pty.

Sometimes, piping stdin and stdout is not enough. There might be a password prompt that doesn't read from stdin, output that changes when it's going to a pipe rather than a terminal, or curses-style interfaces that rely on a terminal. If you need to automate these things, running the process in a pseudo terminal (pty) is the answer.

Interface:

.. code:: python

from ptyprocess import PtyProcessUnicode
p = PtyProcessUnicode.spawn(['python'])
p.read(20)
p.write('6+6\n')
p.read(20)
View on GitHub
GitHub Stars236
CategoryDevelopment
Updated1mo ago
Forks72

Languages

Python

Security Score

80/100

Audited on Feb 17, 2026

No findings