import urllib requesturllib parseurllib error import json import ssl api_key false if you have google places api keyenter it here api_key 'aizasy___idbyt if api_key is falseapi_key serviceurl 'else serviceurl 'ignore ssl certificate errors ctx ssl create_default_context(ctx check_hostname false ctx verify_mode ssl cert_none while trueaddress input('enter location'if len(address break parms dict(parms['address'address if api_key is not falseparms['key'api_key url serviceurl urllib parse urlencode(parmsprint('retrieving'urluh urllib request urlopen(urlcontext=ctxdata uh read(decode(print('retrieved'len(data)'characters'tryjs json loads(dataexceptjs none if not js or 'statusnot in js or js['status'!'ok'print('===failure to retrieve ===='print(datacontinue print(json dumps(jsindent= )lat js['results'][ ]['geometry']['location']['lat'lng js['results'][ ]['geometry']['location']['lng'print('lat'lat'lng'lnglocation js['results'][ ]['formatted_address'print(location