Coders Packet

Python Script to get Weather of any city.

By Paras Rawat

Getting current weather of any city with the help of OpenWeather API, requests, and json module in Python.


1) Get OpenWeather API

2) Install requests

    "pip install requests"

3) Install json

    "pip install json"

Methodology :

1) Import requests and json modules.

2) Get the city name

3) Create a complete URL with the OpenWeather url, your API key, and city name.

4) Create a response object with the get method of requests.

5) With the help json method of response object convert json format data into python-format data.

6) Get all the values as shown and print all the details.

Download Complete Code


No comments yet