I execute the ping command in python by opening a cmd window with the ping command using python's subprocess module.For example:import subprocessp = subprocess.Popen('ping 127.0.0.1')Afterwards I check if the output contains "Reply from 'ip':", to see if the ping was successful.This works in all cases where the cmd is in english.What can I do to check if a ping was successful on any cmd language?
related: Ping a site in Python?
This would work with a simple ping I agree, but what If I have a loop in the batch that pings and returns many results?
yuval You want to do the loop in python or in bash?
in bash, "cmd /C for /l %i in (1, 1, 254) do ping -w 2000 -n 1 195.218.195.%i"