With this simple script I can get the complete location information from the unit GPS.
import location, time
a=""
label1 = ""
def getlocation(sender):
location.start_updates()
time.sleep(1)
label1 = str(location.get_location())
location.stop_updates()
getlocation(a)
print(a)
And the result is the following
{'latitude': 49.305450439453125, 'longitude': 2.5930605239319453, 'altitude': 28.290002822875977, 'timestamp': 1542108670.452639, 'horizontal_accuracy': 140.45985579622024, 'vertical_accuracy': 10.941082954406738, 'speed': -1.0, 'course': -1.0}
But, and Iām sure this is simple but my knowledge of python and programming in general is really poor.
How can I get only latitude and longitude information out of a ?
More generally how can I convert something that seems to be a mix of string and number. As the A variable have quotes and special character like ā:ā.