子流程模块,特使,sarge和pexpect之间的区别? [英] Differences between subprocess module, envoy, sarge and pexpect?
问题描述
我正在考虑制作一个程序,该程序需要从各种aircrack-ng套件工具中发送输入并获取输出.我知道有两个python模块,例如subprocess,envoy,sarge和pexpect,它们可以提供必要的功能.谁能建议我应该使用或不使用的东西,特别是当我刚接触python时.
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.
谢谢
推荐答案
作为sarge
的维护者,我可以告诉您它的目标与envoy
大致相似(就与subprocess
的易用性有关),并且sarge
中有(IMO)相对于以下功能:
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:
- 跨平台支持类似bash的语法(例如在命令行中使用
&&
,||
,&
) - 更好地支持捕获
subprocess
输出流并异步使用它们 - 更多文档,尤其是有关内部和外围问题的信息,例如在使用子进程的上下文中的线程+分叉
- 支持防止外壳注入攻击
- 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
当然是YMMV,但是您可以查看文档,它们是相当全面.
Of course YMMV, but you can check out the docs, they're reasonably comprehensive.
这篇关于子流程模块,特使,sarge和pexpect之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!