<dialog param1="1" param2="2" ...></dialog>
import subprocess
host = 'www.google.com2'
ping = subprocess.Popen(['ping', '-c', '1', host], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
out, error = ping.communicate()
if error:
print('Error:', error.decode('utf-8'))