Sep-08-2020, 06:42 PM
The statement below is from here
I understand that it is slicing and stripping the nmea string, but what is the meaning of the left hand side part:
An Nmea string example would look like:
$GPGGA,172814.0,3723.46587704,N,12202.26957864,W,2,6,1.2,18.893,M,-25.669,M,2.0,0031*4F
And I understand we are extracting the lat and long as:
lat = 3723.46587704
lon = 12202.26957864
So how does it assign lat/lon in one line
(I actually used it successfully, but would like to understand it a bit better)
regards
Russell
I understand that it is slicing and stripping the nmea string, but what is the meaning of the left hand side part:
lat, _, lon = line.strip().split(',')[2:5]In particular with the use of underscore?
An Nmea string example would look like:
$GPGGA,172814.0,3723.46587704,N,12202.26957864,W,2,6,1.2,18.893,M,-25.669,M,2.0,0031*4F
And I understand we are extracting the lat and long as:
lat = 3723.46587704
lon = 12202.26957864
So how does it assign lat/lon in one line
(I actually used it successfully, but would like to understand it a bit better)
regards
Russell