Spaces:
Runtime error
Runtime error
Commit
·
b37d56c
1
Parent(s):
f7f4eea
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,11 @@
|
|
1 |
import requests
|
2 |
import json
|
3 |
-
import sys
|
4 |
|
5 |
# Replace YOUR_API_KEY_HERE with your actual API key from OpenWeatherMap
|
6 |
api_key = "1aafc3163909c1493596da9340e00aee"
|
7 |
|
8 |
-
#
|
9 |
-
|
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}"
|
|
|
1 |
import requests
|
2 |
import json
|
|
|
3 |
|
4 |
# Replace YOUR_API_KEY_HERE with your actual API key from OpenWeatherMap
|
5 |
api_key = "1aafc3163909c1493596da9340e00aee"
|
6 |
|
7 |
+
# Prompt the user to enter the city name
|
8 |
+
city_name = input("Enter city name: ")
|
|
|
|
|
|
|
9 |
|
10 |
# Make the API call to get the current weather details
|
11 |
url = f"https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}"
|