Skip to content

Commit 63dcf1a

Browse files
committed
Update bat script.
1 parent bccf73d commit 63dcf1a

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

set_pythonpath.bat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@echo off
2+
3+
set need_set_pythonpath=1
4+
for %%x in (python.exe) do set python_exe_path=%%~$PATH:x
5+
for /f "delims=" %%p in ('echo %python_exe_path%\..\lib\site-packages\quecpython') do set quecpython_path=%%~fp
6+
if "%PYTHONPATH%" == "" (
7+
echo The path is not set, will be set now.
8+
set PYTHONPATH=%quecpython_path%
9+
) else (
10+
echo %PYTHONPATH% | findstr /C:"%quecpython_path%" > nul
11+
if errorlevel 1 (
12+
echo The path is not set, will be set now.
13+
set PYTHONPATH=%PYTHONPATH%;%quecpython_path%
14+
) else (
15+
echo The path is set before, won't be set again.
16+
set need_set_pythonpath=0
17+
)
18+
)
19+
20+
if %need_set_pythonpath% == 1 (
21+
setx PYTHONPATH %PYTHONPATH%
22+
)

sudo.bat

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)