24 lines
414 B
Batchfile
24 lines
414 B
Batchfile
@echo off
|
|
setlocal
|
|
|
|
cd /d "%~dp0"
|
|
set PORT=8000
|
|
set URL=http://localhost:%PORT%/index.html
|
|
|
|
where py >nul 2>&1
|
|
if %ERRORLEVEL%==0 (
|
|
start "" "%URL%"
|
|
py -3 -m http.server %PORT%
|
|
goto :eof
|
|
)
|
|
|
|
where python >nul 2>&1
|
|
if %ERRORLEVEL%==0 (
|
|
start "" "%URL%"
|
|
python -m http.server %PORT%
|
|
goto :eof
|
|
)
|
|
|
|
echo Python was not found.
|
|
echo Install Python 3 from https://www.python.org/downloads/ and try again.
|
|
pause
|