Bootstrap

python 外部exe程序 交互,在python脚本中包含交互式命令行应用程序

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

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

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.

解决方案

Does PExpect fits your needs?

;