delegator.py 处理子进程调用的包

delegator.py 是受envoy 以及pexpect 启发的一个子进程处理报,此模块主要提供了两个方法,run 以及chain,整体上使用简单

参考使用

  • run 模式
import delegator
c = delegator.run('ls')
print(c.out)
  • chain 模式
import delegator
c = delegator.chain('ls | wc')
print(c.out)

说明

delegator.py 使用上是比较方便的,但是目前就是缺少维护了,同时pip 包的位置比较怪异,不太符合我们一般的pip 包布局模式

参考资料

https://github.com/amitt001/delegator.py

posted on 2025-03-31 08:00  荣锋亮  阅读(23)  评论(0)    收藏  举报

导航