popen_spawn - use pexpect with a piped subprocess¶
Provides an interface like pexpect.spawn interface using subprocess.Popen
PopenSpawn(cmd, timeout=30, maxread=2000, searchwindowsize=None, logfile=None, cwd=None, env=None, encoding=None, codec_errors='strict', preexec_fn=None)¶
__init__(cmd, timeout=30, maxread=2000, searchwindowsize=None, logfile=None, cwd=None, env=None, encoding=None, codec_errors='strict', preexec_fn=None)¶
Initialize self. See help(type(self)) for accurate signature.
Send data to the subprocess’ stdin.
Returns the number of bytes written.
Wraps send(), sending string
sto child process, with os.linesep automatically appended. Returns number of bytes written.
This is similar to send() except that there is no return value.
This calls write() for each element in the sequence.
The sequence can be any iterable object producing strings, typically a list of strings. This does not add line separators. There is no return value.
Sends a Unix signal to the subprocess.
Use constants from the
signalmodule to specify which signal.
Closes the stdin pipe from the writing end.
Wait for the subprocess to finish.
Returns the exit code.