API documentation¶
Wexpect symbols¶
Wexpect package has the following symbols. (Exported by __all__
in code:__init__.py)
spawn
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.
SpawnPipe
wexpect.host.SpawnPipe
is the default spawn class, but you can access it directly with its
exact name.
SpawnSocket
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
run
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()
.
EOF
wexpect.wexpect_util.EOF
is an exception. This usually means the child has exited.
TIMEOUT
wexpect.wexpect_util.TIMEOUT
raised when a read time exceeds the timeout.
__version__
This gives back the version of the wexpect release. Versioning is handled by the pbr package, which derives it from Git tags.
spawn_class_name
Contains the default spawn class’ name even if the user has not specified it. The value can be
SpawnPipe
or SpawnSocket
ConsoleReaderSocket
For advanced users only!
wexpect.console_reader.ConsoleReaderSocket
ConsoleReaderPipe
For advanced users only!
wexpect.console_reader.ConsoleReaderPipe