I'm trying to learn networking with python and would like to make a simple ping script that includes the response time as well. I don't really know where to start and if I could use the the socket module to help with this project.
Asked
Active
Viewed 2.2k times
1
-
1possible duplicate: http://stackoverflow.com/questions/2953462/pinging-servers-in-python – kasper Taeymans Feb 02 '15 at 21:06
-
ICMP is a Layer 3 protocol in OSI model, I dont think think you need sockets. – cmidi Feb 02 '15 at 21:25
1 Answers
1
Why don't you just use the os
module from the standard python library:
import os
hosts = [] # list of host addresses
for host in hosts:
os.system('ping ' + host)

Malik Brahimi
- 16,341
- 7
- 39
- 70
-
1can it also output the response time, sorry I forgot that out of the question when i posted. – Freddy-FazBear Feb 02 '15 at 21:16