README.rst 541 B

123456789101112131415
  1. Launch a subprocess in a pseudo terminal (pty), and interact with both the
  2. process and its pty.
  3. Sometimes, piping stdin and stdout is not enough. There might be a password
  4. prompt that doesn't read from stdin, output that changes when it's going to a
  5. pipe rather than a terminal, or curses-style interfaces that rely on a terminal.
  6. If you need to automate these things, running the process in a pseudo terminal
  7. (pty) is the answer.
  8. Interface::
  9. p = PtyProcessUnicode.spawn(['python'])
  10. p.read(20)
  11. p.write('6+6\n')
  12. p.read(20)