在python脚本中包含交互式命令行应用程序 [英] Wrapping an interactive command line application in a python script

查看:291
本文介绍了在python脚本中包含交互式命令行应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣从python调用控制交互式CLI应用程序。

I am interested in controlling an interactive CLI application from python calls.

我想在最基本的级别我需要一个python脚本,将启动CLI应用程序主机操作系统。管道任何从stdin到cli应用程序,然后管道任何输出从cli应用程序到stdout。

I guess at the most basic level I need a python script that will start a CLI application on the host OS. Pipe anything from stdin to the cli application, and then pipe any output from the cli application to stdout.

从这个基础应该是很简单的做一些处理输入和输出

From this base It should be pretty straightforward to do some processing on the input and output

说实话,我可能只需要一个指针来调用tecnique。我不知道我需要寻找什么。

To be honest I probably just need a pointer on what the tecnique is called. I have no idea what I need to be searching for.

推荐答案

PExpect 符合您的需求?

这篇关于在python脚本中包含交互式命令行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆