def ping(ip): try: urlopen("http://" + ip + ":1921/name").read() return True except URLError: return False