When i did something in Python as:
ping = subprocess.Popen("ping -n 1 %s" %ip, stdout=subprocess.PIPE)
it is always to print out to screen:
(subprocess.Popen object at 0x.... )
It’s a bit annoying for me. Do you know how to avoid that std output ?
It looks like you’re trying to get the stdout from the process by printing the
pingvariable in your example. That is incorrect usage ofsubprocess.Popenobjects. In order to correctly usesubprocess.Popenthis is what you would write:I also changed the arguments you used for ping because
-nis an invalid argument on my machines implementation.