From 2e6e100c638a99f647e4337d2317bad7f77cce30 Mon Sep 17 00:00:00 2001 From: KWON Date: Fri, 27 Jun 2025 15:22:55 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20=EA=B0=80?= =?UTF-8?q?=EB=8F=85=EC=84=B1=20=ED=96=A5=EC=83=81=20CSS=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/weather.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/data/weather.py b/data/weather.py index edb2bdf..4882bbe 100644 --- a/data/weather.py +++ b/data/weather.py @@ -39,26 +39,29 @@ def get_precipitation_summary(retry=True): total_rainfall = 0.0 lines = [ - '
', - '

[시간대별 강수량]

', - '', + '
', + '

[시간대별 강수량]

', + '
', + '', '', - '', - '', - '' + '', + '', + '', + '', + '' ] for item in data['response']['body']['items']['item']: if item['category'] == 'PCP' and item['fcstDate'] == TODAY: - time = item['fcstTime'] # 예: '1100' + time = item['fcstTime'] if 900 < int(time) < 2300: mm = parse_precip(item['fcstValue']) - time_str = f"{time[:2]}:{time[2:]}" # '11:00' - lines.append(f'') + time_str = f"{time[:2]}:{time[2:]}" + lines.append(f'') total_rainfall += mm - lines.append(f'') - lines.append('
시간강수량
시간강수량
{time_str}{mm}mm
{time_str}{mm}mm
영업시간 중 총 예상 강수량: {total_rainfall:.1f}mm
') + lines.append(f'영업시간 중 총 예상 강수량: {total_rainfall:.1f}mm') + lines.append('') return ''.join(lines)