Im having python ping numerous IP's. Upon one failed ping it sends an error code to be displayed on an LED. Going from a good ping to a failed ping can take up to 10 seconds to update. I'm looking for a faster response time there. Here's what im currently using to ping a particular server. Its on a raspberry pi of that helps, also.
response = subprocess.call(['ping', '-c', '1',ip])