36 lines
995 B
Batchfile
36 lines
995 B
Batchfile
@echo off
|
|
echo Checking for Python installation...
|
|
|
|
:: Kiểm tra xem Python có được cài đặt không
|
|
py --version >nul 2>&1
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Error: Python is not installed or not added to PATH.
|
|
echo Please install Python from https://www.python.org/ and ensure it's added to PATH.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
:: Kiểm tra xem file stress_test.py có tồn tại không
|
|
if not exist "stress_test.py" (
|
|
echo Error: stress_test.py not found in the current directory.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
:: Kiểm tra và cài đặt thư viện requests nếu chưa có
|
|
echo Checking for requests library...
|
|
py -c "import requests" >nul 2>&1
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Installing requests library...
|
|
pip install requests
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Error: Failed to install requests library.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
)
|
|
|
|
:: Chạy file stress_test.py
|
|
echo Running stress_test.py...
|
|
py stress_test.py
|
|
pause |