import subprocess, platform
def ping(host):
args = "ping -n 1 " + host
return subprocess.call(args) == 0
print(ping("www.google.com"))
I am using this code in order to ping a website to test whether it is up or down, which works perfectly, however it results in a command prompt window briefly appearing which is not ideal for what I am working on, so my question is; How can I supress this window from appearing on pings requests (windows based solution needed)