fdpexpect — Like pexpect, but will work on any file descriptor that you pass it.

This is like pexpect, but will work on any file descriptor that you pass it. So you are reponsible for opening and close the file descriptor.

$Id: fdpexpect.py 505 2007-12-26 21:33:50Z noah $

class fdpexpect.fdspawn(fd, args=[], timeout=30, maxread=2000, searchwindowsize=None, logfile=None)

This is like pexpect.spawn but allows you to supply your own open file descriptor. For example, you could use it to read through a file looking for patterns, or to control a modem or serial device.

isalive()

This checks if the file descriptor is still valid. If os.fstat() does not raise an exception then we assume it is alive.

Previous topic

pexpect — Spawn child applications and control them automatically.

Next topic

pxssh — Extends pexpect.spawn to specialize setting up SSH connections.

This Page