Files
growth_report/start_app.bat

49 lines
1.5 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
:: ------------------------------------------------
:: 自动切换编码为 UTF-8解决中文乱码问题
chcp 65001 >nul
:: ------------------------------------------------
title 幼儿园成长报告助手启动器
cd /d "%~dp0"
echo.
echo ==========================================
echo 正在启动 幼儿园成长报告助手
echo ==========================================
echo.
:: 1. 检查 uv 是否安装
uv --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] 未检测到 uv 工具!
echo 请先运行: pip install uv
pause
exit /b
)
echo [INFO] 环境检查通过...
:: 2. 检查依赖是否安装 (可选,防止第一次运行报错)
:: 如果你有 pyproject.tomluv run 会自动处理,这一步可以省略
:: 这里为了保险,检查一下 loguru 是否存在,不存在则自动安装基础依赖
uv pip show loguru >nul 2>&1
if %errorlevel% neq 0 (
echo [INFO] 首次运行,正在安装依赖...
uv pip install loguru toml pandas pillow openpyxl python-pptx
)
echo [INFO] 正在拉起主程序...
echo ---------------------------------------------------
:: =======================================================
:: 【关键修改】路径改为根目录的 main.py
:: 使用 start 命令启动,这样黑色的 CMD 窗口可以随后立即关闭
:: =======================================================
start "" uv run main.py
:: 等待 1 秒确保启动
timeout /t 1 >nul
:: 退出 CMD 窗口 (让用户只看到 GUI)
exit