Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Last active June 23, 2024 00:01
Show Gist options
  • Save pythoninthegrass/00796ffc20647762c11cc164ff6fb5c5 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/00796ffc20647762c11cc164ff6fb5c5 to your computer and use it in GitHub Desktop.
geopy test file
#!/usr/bin/env python
import os
from geopy.geocoders import Nominatim
from pprint import pprint
app = Nominatim(user_agent="tutorial")
if len(os.sys.argv) > 1:
your_loc = os.sys.argv[1]
else:
your_loc = input("Enter your location: ")
location = app.geocode(your_loc)
pprint(location)
@pythoninthegrass
Copy link
Author

pythoninthegrass commented Jun 22, 2024

git clone https://gist.github.com/00796ffc20647762c11cc164ff6fb5c5.git geopy_test
cd geopy_test
python -m venv .venv
source .venv/bin/activate
python -m pip install geopy
./main.py orange county
deactivate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment