Pexpect on Windows New in version 4.0: Windows support
Pexpect can be used on Windows to wait for a pattern to be produced by a child process, using pexpect.popen_spawn.PopenSpawn, or a file descriptor, using pexpect.fdpexpect.fdspawn. This should be considered experimental for now.
pexpect.spawn and pexpect.run() are not available on Windows, as they rely on Unix pseudoterminals (ptys). Cross platform code must not use these.
Look at the result of dir below. There is no sendline method in the pexpect module, so AttributeError will be reported.
Correct usage examples are as follows:
To call the sendline method on the return value of pexpect.spawn(cmd), refer to: http://pexpect.readthedocs.org/en/stable/overview.html
Pexpect on Windows
New in version 4.0: Windows support
Pexpect can be used on Windows to wait for a pattern to be produced by a child process, using pexpect.popen_spawn.PopenSpawn, or a file descriptor, using pexpect.fdpexpect.fdspawn. This should be considered experimental for now.
pexpect.spawn and pexpect.run() are not available on Windows, as they rely on Unix pseudoterminals (ptys). Cross platform code must not use these.