Reputation: 129
I am working on a project which requires my current location's exact lat-long. I tried to run the code using Google Maps API as well as http://freegeoip.net/json on windows 7 machine, but nothing seems to take 'My current location' as an input and output the exact lat-long.
Can someone please help?
Thanks, Sanket.
Upvotes: 1
Views: 7621
Reputation: 483
This is very simple. You can try this one
first, you need to install the geocoder module
pip install geocoder
Then you can try this one
import geocoder
myloc = geocoder.ip('me')
print(myloc.latlng)
Upvotes: 5