Nov-28-2019, 01:01 PM
Don't use os.system for that.
Example
Example
from subprocess import check_output out = check_output(["ping", "-c 5", "8.8.8.8"]) print("".join(map(chr, out)))
Output:PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=27.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=28.2 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=28.2 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=27.6 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=57 time=27.9 ms
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 27.394/27.886/28.269/0.389 ms