title: Output only the ping latency when using the ping command in python
body: <pre><code>import subprocess
  ping = subprocess.Popen(["ping", "youtube.com", "-n", "1"], stdout = subprocess.PIPE,stderr = subprocess.PIPE, shell=True)
  output = ping.communicate()
  </code></pre>
  
  <p>The the above code is what I am using to ping a server once in Python, I am then able to output the result of the ping to the python Idle, which I will use later in the program. However the problem I have is that I do not want all of the output provided:</p>
  
  <pre><code>print(output)
  # below is the output from this command
  (b'\r\nPinging youtube.com [216.58.208.174] with 32 bytes of data:\r\nReply from 216.58.208.174: bytes=32 time=17ms TTL=54\r\n\r\nPing statistics for 216.58.208.174:\r\n    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),\r\nApproximate round trip times in milli-seconds:\r\n    Minimum = 17ms, Maximum = 17ms, Average = 17ms\r\n', b'')
  </code></pre>
  
  <p>So, my question to wrap up is, how would I be able to simply capture the:</p>
  
  <pre><code> time = 17ms
  </code></pre>
  
  <p>(or whatever the command outputs here at the time)
   A point in the right direction would be appreciated. Thanks.</p>