Every line of 'python ping' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
8 @route('/ping', method='GET') 9 def ping(): 10 return "1"
63 def ping(client, args): 64 print(client.ping())
7 def ping(host, count=1, timeout=1): 8 cmd = [ 9 'ping', 10 '-c', 11 str(count), 12 '-w', 13 str(timeout), 14 host, 15 ] 16 17 sub = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) 18 sub.communicate() 19 ret = sub.wait() == 0 20 return ret