How to find the Geo Location using python || How to find the Geo Coordinated using python

Опубликовано: 01 Октябрь 2024
на канале: CODE HUB
852
13

Want to code like Iron Man , You are at the right place , take a look at our channel
If you have any doubt then feel free to join our discord server and clarify your doubts
DISCORD:   / discord   python mini projects how to find the location using python

you can get the code in github :https://github.com/MRMYSTERY003/Geo-l...

first you need to install python on your system and then you need to install a module called pywhatkit ,enter the following command in the command prompt

pip install geopy

###code####
from geopy.geocoders import Nominatim
import time

app = Nominatim(user_agent = 'tutorial')
def get_loc(adr):
time.sleep(1)
try:
return app.geocode(adr).raw
except :
return get_loc(adr)

print('-'*10)
adr = input('Enter the name of a country/state/city:')

location = get_loc(adr)

lat = location['lat']
lon = location['lon']
name = location['display_name']

print(f'location = {name} \nlatitude = {lat} longitude = {lon}')

####code end####

if got stuck at any point contact me at instagram link in channel banner


website to enter the coordinates :https://latlongdata.com/latitude-long...

How to find the Geo Location using python || How to find the Geo Coordinated using python