How do I ping a website or IP address with Python?
You can find an updated version of the mentioned script that works on both Windows and Linux here