LT is possible to know the location of the person in PYTHON?

There is a small challenge for you: find the coordinates of the user using python3 (latitude and longitude), searched through the Internet I could not find (probably badly searched).
March 23rd 20 at 19:12
4 answers
March 23rd 20 at 19:14
Solution
Once the desired geolocation - so wearable device once the wearable device means Android, since Android means QPython+SL4A:
# import needed modules
import android
import time
import sys, select, os #for loop exit

#Initiate the android module
droid = android.Android()

#notify me
droid.makeToast("fetching GPS data")

print("start gps-sensor...")
droid.startLocating()

while True:
 #exit loop hook
 if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
 line = input()
 print("exit endless loop...")
break

 #wait for location-event
 event = droid.eventWaitFor('location',10000).result
 if event['name'] == "location":
try:
 #try to get gps location data
 timestamp = repr(event['data']['gps']['time'])
 longitude = repr(event['data']['gps']['longitude'])
 latitude = repr(event['data']['gps']['latitude'])
 altitude = repr(event['data']['gps']['altitude'])
 speed = repr(event['data']['gps']['speed'])
 accuracy = repr(event['data']['gps']['accuracy'])
 loctype = "gps"
 except KeyError:
 #if no gps data, get the network location instead (inaccurate)
 timestamp = repr(event['data']['network']['time'])
 longitude = repr(event['data']['network']['longitude'])
 latitude = repr(event['data']['network']['latitude'])
 altitude = repr(event['data']['network']['altitude'])
 speed = repr(event['data']['network']['speed'])
 accuracy = repr(event['data']['network']['accuracy'])
 loctype = "net"

 data = loctype + ";" + timestamp + ";" + longitude + ";" + latitude + ";" + altitude + ";" + speed + ";" + accuracy

 print(data) #logging
 time.sleep(5) #wait for 5 seconds

print("stop gps-sensor...")
droid.stopLocating()
March 23rd 20 at 19:16
Possible.

1. Take the documentation for your device in the address to the GPS or where you there the data location to read together.
2. Read how to get the right data.
3. Get.
March 23rd 20 at 19:18
If no GPS is possible to determine the approximate now be positioned with precision over IP

https://www.ip2location.com/developers/python

www.ip2geo.net/ip2location/lookup.php
March 23rd 20 at 19:20
If You need to define IP as an option you can use ipGeoBase blog.ivru.net/?id=82

Find more questions by tags GeolocationPython