From 4072ee1c98fc7d88ef95cffac1d068dcee068fd6 Mon Sep 17 00:00:00 2001 From: cjx12036 Date: Tue, 17 Mar 2026 17:25:56 -0400 Subject: [PATCH] Fix JSON key access for current weather condition --- ...\210\235\350\257\206\346\231\272\350\203\275\344\275\223.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/docs/chapter1/\347\254\254\344\270\200\347\253\240 \345\210\235\350\257\206\346\231\272\350\203\275\344\275\223.md" "b/docs/chapter1/\347\254\254\344\270\200\347\253\240 \345\210\235\350\257\206\346\231\272\350\203\275\344\275\223.md" index cf8625eb..198b2899 100644 --- "a/docs/chapter1/\347\254\254\344\270\200\347\253\240 \345\210\235\350\257\206\346\231\272\350\203\275\344\275\223.md" +++ "b/docs/chapter1/\347\254\254\344\270\200\347\253\240 \345\210\235\350\257\206\346\231\272\350\203\275\344\275\223.md" @@ -283,7 +283,7 @@ def get_weather(city: str) -> str: data = response.json() # 提取当前天气状况 - current_condition = data['current_condition'][0] + current_condition = data['data']['current_condition'][0] weather_desc = current_condition['weatherDesc'][0]['value'] temp_c = current_condition['temp_C']