PTT/run.bat

34 lines
638 B
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

@echo off
chcp 65001 >nul
echo 正在启动采集箱出厂测试工具...
echo.
REM 检查Python
python --version >nul 2>&1
if errorlevel 1 (
echo 错误: 未找到Python请确保Python已安装并添加到PATH
pause
exit /b 1
)
REM 检查虚拟环境
if exist venv\Scripts\activate.bat (
call venv\Scripts\activate.bat
) else (
echo 创建虚拟环境...
python -m venv venv
call venv\Scripts\activate.bat
echo 安装依赖...
pip install -r requirements.txt
)
REM 运行程序
python src\main.py
REM 暂停查看错误信息
if errorlevel 1 (
echo.
echo 程序异常退出
pause
)