小编And*_*rea的帖子

如何用Python包装CLI程序(保持交互性)?

我想为交互式CLI程序(Asterisk CLI)编写一个包装器.

基本上,我需要保持与CLI的交互(包括tab-completion),但我想过滤Asterisk的输出,以便只显示与给定模式匹配的行.

我尝试了一种基于select()的方法,使用popen.popen4并在read_fs中放入asterisk stdout_and_stderr和sys.stdin,但它有点不起作用.

谁能给我一些好的指示?

非常感谢,安德里亚

python select interactive command-line-interface wrapper

3
推荐指数
1
解决办法
1035
查看次数