title: Is there a ping command in python that returns a different value if a host is up, or if a host is down?
body: <p>I am trying to create a utility to visualize if a set of IPs in my local network are up using python. I stumbled into a problem right away, because my plan was to use something like:</p>
  
  <pre><code>isup=os.system("ping IP")
  </code></pre>
  
  <p>And than depending on the value of <code>isup</code> I would either display that the host is online, or offline, but no matter which it is, only 0 is constantly being returned. I am using win7, and I would like to do this in python. Any help is highly appreciated!</p>
  
  <p>Edit:
  Please stop flagging this as a duplicate, the solutions in that question are either for Linux or python 2.x.</p>