从Python运行需要用户输入的Shell脚本

时间:2018-08-01 17:25:38

标签: python python-2.7

我有一个shell命令,需要从stdin进行如下的用户确认

support@vrni-platform:/tmp$ patronictl -c /etc/patroni/patroni.yml remove arkin
+---------+--------+------+------+-------+-----------+
| Cluster | Member | Host | Role | State | Lag in MB |
+---------+--------+------+------+-------+-----------+
+---------+--------+------+------+-------+-----------+
Please confirm the cluster name to remove: arkin
You are about to remove all information in DCS for arkin, please type: "Yes I am aware": Yes I am aware

最后两行需要用户输入。

有人可以让我知道如何使用不需要用户输入的Python 2.7自动执行上述操作吗?

0 个答案:

没有答案