Add Exception
This commit is contained in:
		| @@ -10,6 +10,7 @@ def get_location(address): | ||||
|     location = geolocator.geocode(address) | ||||
|     return location.latitude, location.longitude | ||||
|  | ||||
| try: | ||||
|    adresse = input("Entrez une adresse : ") | ||||
|    lat, lon = get_location(adresse) | ||||
|     | ||||
| @@ -29,3 +30,5 @@ print(f"Coordonnées de l'adresse {adresse} : {lat}, {lon}") | ||||
|    # Ouvrir le fichier HTML dans le navigateur web par défaut | ||||
|    print("Ouverture de la carte dans le navigateur web...") | ||||
|    webbrowser.open("map.html") | ||||
| except AttributeError: | ||||
|    print("adresse inconnue !") | ||||
		Reference in New Issue
	
	Block a user