API documentation — Pexpect 4.2.1 documentation

# API documentation

- Core pexpect components
  - spawn class
  - run function
  - Exceptions
  - Utility functions
- fdpexpect - use pexpect with a file descriptor
  - fdspawn class
- popen_spawn - use pexpect with a piped subprocess
  - PopenSpawn class
- replwrap - Control read-eval-print-loops
- pxssh - control an SSH session
  - pxssh class

The modules `pexpect.screen` and `pexpect.ANSI` have been deprecated in Pexpect version 4. They were separate from the main use cases for Pexpect, and there are better maintained Python terminal emulator packages, such as pyte. These modules are still present for now, but we don’t advise using them in new code.