Skip to content

Tag: subprocess

Ping command – Check returned value

How can I evaluate the return of ping command used on subprocess.call(), by having a value of True or False like in the last “if” statement ? Here is the code: The code is working as it should, by iterating on a range of IP addresses (which it get from a XLSX file) and by pinging the single IP add…

Get date using subprocess python?

I used subprocess to get information on a directory in my VM. and i get the output as How can i get just the date from the above output? Thank you Answer As an alternative, since you are already using a subprocess might as well use it all the way: should get you output in the format: Apr 25 2019