Yes, python has something to capture the output of a program.
Since you mention exe, I assume you'll use Windows. In this case, you need an airpcap hardware device.
Since you mention exe, I assume you'll use Windows. In this case, you need an airpcap hardware device.