0
我想运行一些打开另一个shell的命令,我可以输入特定的命令。在那个shell中,我想在循环中运行另一个命令。 更具体的 - 在我的例子,它看起来像这样:如何从python中的另一个shell执行命令?
> openssl s_client -connect 10.10.10.10:10000 ### this is the first command
CONNECTED(00000003) ### some output
(...)
### now i'd like to type 'R' in a loop (R means renegotiate)
什么是做到这一点的最好方法是什么?在此先感谢您的帮助
我认为你正在寻找子https://docs.python.org/2/library/subprocess.html – ginginsha