Traditional Culture Encyclopedia - Weather forecast - How to use python and api to get weather forecast
How to use python and api to get weather forecast
Try this: /weather_mini? city key = 10 12 10 10 1
The returned data is compressed by gzip. If you use urllib, you need to decompress the obtained binary data before decoding it into a string. It is much more convenient to use the requests library, including coding, which will automatically help you solve it, so you don't need to worry about it yourself.
By the way, I recommend Chrome's JSON-Handle plug-in. It's very convenient to view JSON.
- Related articles
- Where can I download the real-time water level query app in Hunan?
- What is Jersey in England?
- Sixth grade imaginary composition 300 words
- Is it still cold in July and September?
- Do you think it necessary to wear a scarf when playing sports with children outside?
- Send a beautiful sentence after the festival and recommend it to a circle of friends.
- What is the dog days in 2024?
- Introduction of Zhuhai Changlong Ocean Kingdom
- Qi Huangong has many wives and children. Is there really no one to collect the body after his death?
- Do you know the top ten famous foods in Puyang, Henan?