添加readme文件及构建脚本

This commit is contained in:
2025-05-25 17:31:34 +08:00
parent 0a9bd74d8e
commit 811cb9eb6b
2 changed files with 59 additions and 0 deletions

36
build.bat Normal file
View File

@@ -0,0 +1,36 @@
@echo off
setlocal
echo === 尝试激活虚拟环境 ===
if exist ".venv\Scripts\activate.bat" (
call .venv\Scripts\activate.bat
) else (
echo 未发现虚拟环境,尝试创建中...
python -m venv .venv
if errorlevel 1 (
echo [错误] 创建虚拟环境失败,请确认是否已安装 Python。
pause
exit /b 1
)
echo 虚拟环境创建成功,开始激活...
call .venv\Scripts\activate.bat
)
echo === 安装依赖项 ===
pip install -r requirements.txt
if errorlevel 1 (
echo [错误] pip 安装依赖失败!
pause
exit /b 1
)
echo === 使用 pyinstaller 构建 ===
pyinstaller .\main.spec
if errorlevel 1 (
echo [错误] 构建失败!
pause
exit /b 1
)
echo === 构建完成 ===
pause