Actually this is for personal use
This commit is contained in:
parent
8562d9f2bf
commit
a0cb496ffc
20 changed files with 2229 additions and 0 deletions
25
placegen.py
Normal file
25
placegen.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import time
|
||||
from geopy.geocoders import Nominatim
|
||||
|
||||
geo = Nominatim(user_agent="python3")
|
||||
|
||||
place = input("Place to look up: ")
|
||||
|
||||
lat = None
|
||||
while lat == None:
|
||||
try:
|
||||
lat = geo.geocode(place).latitude
|
||||
except:
|
||||
time.sleep(3)
|
||||
continue
|
||||
|
||||
thelong = None
|
||||
while thelong == None:
|
||||
try:
|
||||
thelong = geo.geocode(place).longitude
|
||||
except:
|
||||
time.sleep(3)
|
||||
continue
|
||||
|
||||
|
||||
print("{\"lookup\":\"" + place + "\",\"lat\":" + str(lat) + ",\"long\":" + str(thelong) + "}")
|
Loading…
Add table
Add a link
Reference in a new issue