File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import json
55from datetime import datetime
66
7+ # asking the user for api key
8+ api_key = input ("Please Enter Your API: " )
9+
10+ #asking the user for city name
11+ city_name = input ("Please Enter Your City Name: " )
12+
713# Register yourself here and get the API key first: openweathermap.org
814# API Key would be something like this: 2f8b2c69352e89120becd33028a1c986
915# We have to call Current weather data API: https://openweathermap.org/current (There are many APIs there)
@@ -16,12 +22,6 @@ def time_from_utc_with_timezone(utc_with_tz):
1622 local_time = datetime .utcfromtimestamp (utc_with_tz )
1723 return local_time .time ()
1824
19- # Enter your API key
20- api_key = ""
21-
22- # Get city name from user
23- city_name = input ("Enter city name : " )
24-
2525# API url
2626weather_url = 'http://api.openweathermap.org/data/2.5/weather?q=' + city_name + '&appid=' + api_key
2727
You can’t perform that action at this time.
0 commit comments