Use check_call for ping instead of os.system