API documentation

Wexpect symbols

Wexpect package has the following symbols. (Exported by __all__ in code:__init__.py)


This is the main class interface for Wexpect. Use this class to start and control child applications. There are two implementation: wexpect.host.SpawnPipe uses Windows-Pipe for communicate child. wexpect.SpawnSocket uses TCP socket. Choose the default implementation with WEXPECT_SPAWN_CLASS environment variable, or the wexpect.host.SpawnPipe will be chosen by default.


wexpect.host.SpawnPipe is the default spawn class, but you can access it directly with its exact name.


wexpect.host.SpawnSocket is the secondary spawn class, you can access it directly with its exact name or by setting the WEXPECT_SPAWN_CLASS environment variable to SpawnSocket


wexpect.host.run() runs the given command; waits for it to finish; then returns all output as a string. This function is similar to os.system().


wexpect.wexpect_util.EOF is an exception. This usually means the child has exited.


wexpect.wexpect_util.TIMEOUT raised when a read time exceeds the timeout.


This gives back the version of the wexpect release. Versioning is handled by the pbr package, which derives it from Git tags.


Contains the default spawn class’ name even if the user has not specified it. The value can be SpawnPipe or SpawnSocket


For advanced users only! wexpect.console_reader.ConsoleReaderSocket


For advanced users only! wexpect.console_reader.ConsoleReaderPipe