Spaces:
Runtime error
Runtime error
Commit
·
acaf7d5
1
Parent(s):
13e0925
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,11 @@ import sys
|
|
| 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
|
| 9 |
city_name = sys.argv[1]
|
| 10 |
|
|
|
|
| 5 |
# Replace YOUR_API_KEY_HERE with your actual API key from OpenWeatherMap
|
| 6 |
api_key = "1aafc3163909c1493596da9340e00aee"
|
| 7 |
|
| 8 |
+
# Check if a city name was provided as a command line argument
|
| 9 |
+
if len(sys.argv) < 2:
|
| 10 |
+
print("Please provide a city name as a command line argument.")
|
| 11 |
+
sys.exit(1)
|
| 12 |
+
|
| 13 |
# Get the city name from the command line arguments
|
| 14 |
city_name = sys.argv[1]
|
| 15 |
|