From fb62bb28b431e8ef999e79e3cfda6f547fb9e36e Mon Sep 17 00:00:00 2001 From: KWON Date: Fri, 27 Jun 2025 13:32:51 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=B8=EB=AC=B8=20=EB=82=B4=EC=9A=A9?= =?UTF-8?q?=EC=97=90=20=EB=82=A0=EC=94=A8=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20?= =?UTF-8?q?=EA=B5=AC=EC=B2=B4=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EC=98=AC?= =?UTF-8?q?=EB=A6=B4=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/gnu_autoupload.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/data/gnu_autoupload.py b/data/gnu_autoupload.py index 44ea6f3..e885ee0 100644 --- a/data/gnu_autoupload.py +++ b/data/gnu_autoupload.py @@ -20,6 +20,7 @@ import pymysql import ftputil from config import DB_CONFIG, FTP_CONFIG, MAIN +from weather import get_precipitation_summary # --------------------------- @@ -29,7 +30,7 @@ def capture_image(script_path, output_path, max_attempts=5): for attempt in range(max_attempts): print(f"[{datetime.now().strftime('%H:%M:%S')}] 이미지 캡처 시도 {attempt + 1}/{max_attempts}") try: - subprocess.run(['python3', script_path], check=True) + subprocess.run([sys.executable, script_path], check=True) except subprocess.CalledProcessError as e: print(f"[오류] weather_capture.py 실행 실패: {e}") if os.path.isfile(output_path): @@ -151,6 +152,12 @@ def write_board(board, subject, content, mb_id, nickname, ca_name=None, file_lis # 메인 실행 함수 # --------------------------- def main(): + # 날씨 정보 문자열 얻기 + weather_content = get_precipitation_summary() + + # MAIN['content'] 업데이트 + MAIN['content'] = weather_content + today = datetime.today().strftime('%Y%m%d') script_dir = os.path.dirname(os.path.abspath(__file__)) capture_script = os.path.join(script_dir, 'weather_capture.py')