python执行cmd执行ctrl+c_python执行cmd命令,怎么让他执行类似Ctrl+C效果将其结束命令?...

[root@jenkins xxxx]# time ping baidu.com -w 10s

PING baidu.com (220.181.57.217) 56(84) bytes of data.

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=1 ttl=52 time=4.07 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=2 ttl=52 time=26.9 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=3 ttl=52 time=6.78 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=4 ttl=52 time=12.9 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=5 ttl=52 time=3.86 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=6 ttl=52 time=3.30 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=7 ttl=52 time=5.63 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=8 ttl=52 time=11.2 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=9 ttl=52 time=4.30 ms

64 bytes from 220.181.57.217 (220.181.57.217): icmp_seq=10 ttl=52 time=4.17 ms

--- baidu.com ping statistics ---

10 packets transmitted, 10 received, 0% packet loss, time 9013ms

rtt min/avg/max/mdev = 3.300/8.328/26.972/6.954 ms

real 0m10.006s

user 0m0.003s

sys 0m0.006s

不知道能不能满足你的需求

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值