1pip install googlemaps
2
3import googlemaps
4from datetime import datetime
5
6gmaps = googlemaps.Client(key='Add Your Key here')
7
8# Geocoding an address
9geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA')
10
11# Look up an address with reverse geocoding
12reverse_geocode_result = gmaps.reverse_geocode((40.714224, -73.961452))
13
14# Request directions via public transit
15now = datetime.now()
16directions_result = gmaps.directions("Sydney Town Hall",
17 "Parramatta, NSW",
18 mode="transit",
19 departure_time=now)
1 pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
1# python3 -m pip install webbrowser
2import webbrowser
3
4question = input("What is your question? ")
5webbrowser.open("https://www.google.com" + str(question))