Search code examples
pythonsubprocesspexpectpython-envoy

Differences between subprocess module, envoy, sarge and pexpect?


I am thinking about making a program that will need to send input and take output from the various aircrack-ng suite tools. I know of a couple of python modules like subprocess, envoy, sarge and pexpect that would provide the necessary functionality. Can anyone advise on what I should be using or not using, especially as I'm new to python.

Thanks


Solution

  • As the maintainer of sarge, I can tell you that its goals are broadly similar to envoy (in terms of ease of use over subprocess) and there is (IMO) more functionality in sarge with respect to:

    • Cross-platform support for bash-like syntax (e.g.use of &&, ||, & in command lines)
    • Better support for capturing subprocess output streams and working with them asynchronously
    • More documentation, especially about the internals and peripheral issues like threading+forking in the context of using subprocess
    • Support for prevention of shell injection attacks

    Of course YMMV, but you can check out the docs, they're reasonably comprehensive.