title: Extracting Latitude and Longitude data from USB sensor (Python 3.4)
body: <p>I want to obtain Latitude and Longitude data from a USB GPS Sensor. 
  I can access the output of the GPS using the following code.</p>
  
  <pre><code>import time, serial
  port ='COM5'
  ser = serial.Serial(port)
  ser.baudrate = 4800
  line = ser.readline()
  line2 = line.decode('latin-1')
  print(line2.find("$GPGGA") != -1) #true when Lat &amp; Long is available
  print(line)
  </code></pre>
  
  <p>Different data is returned when I rerun the code. However, when the returned information contains the prefix “$GPGGA” Latitude and Longitude information is present (see Screenshot).  <a href="https://i.stack.imgur.com/rYgwi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rYgwi.jpg" alt="enter image description here"></a></p>
  
  <p>What is the best way to just extract/parse the Latitude and Longitude data from the returned data? </p>
  
  <p>I feel this should be dead simple, and I am missing something basic. </p>
  
  <p>New to programing .
  Thanks 
  Steve  </p>