PExpect is a Python library used to interact with other executable applications from within your Python script. I use it a lot to interact with FFMpeg. Unfortunately, PExpect does not work out of the box with Windows systems – it is designed specifically for Linux (and similar operating systems such as Mac OS X).

Thankfully, there is a fork of PExpect called WExpect. This version brings the functionality of PExpect to a Windows environment.

In order to use WExpect, you must install CygWin, and then install the WExpect script into your system (dropping the py file into your working directory is usually good enough).

I’ve found the functionality is pretty much the same, so you should be able to use the PExpect manual and examples and apply them to this Microsoft Windows variant.

WExpect does not have a sexy homepage or website touting it’s amazing features. It’s just a py file uploaded on a edu website. In case this super handy text file disappears from the internet, here is a copy of it I’ve uploaded to Github.

Download WExpect from Github

I did not develop this application. I am simply providing a copy in Github for your convenience.