Spaces:
Runtime error
Runtime error
Commit
·
f7f4eea
1
Parent(s):
acaf7d5
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,13 +5,11 @@ import sys
|
|
| 5 |
# Replace YOUR_API_KEY_HERE with your actual API key from OpenWeatherMap
|
| 6 |
api_key = "1aafc3163909c1493596da9340e00aee"
|
| 7 |
|
| 8 |
-
#
|
| 9 |
if len(sys.argv) < 2:
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
# Get the city name from the command line arguments
|
| 14 |
-
city_name = sys.argv[1]
|
| 15 |
|
| 16 |
# Make the API call to get the current weather details
|
| 17 |
url = f"https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}"
|
|
|
|
| 5 |
# Replace YOUR_API_KEY_HERE with your actual API key from OpenWeatherMap
|
| 6 |
api_key = "1aafc3163909c1493596da9340e00aee"
|
| 7 |
|
| 8 |
+
# Get the city name from the command line arguments, or use a default value
|
| 9 |
if len(sys.argv) < 2:
|
| 10 |
+
city_name = "London"
|
| 11 |
+
else:
|
| 12 |
+
city_name = sys.argv[1]
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Make the API call to get the current weather details
|
| 15 |
url = f"https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}"
|