-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.cmd
More file actions
47 lines (35 loc) · 1.2 KB
/
python.cmd
File metadata and controls
47 lines (35 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@ECHO OFF
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
REM This script provides a single entry point that you can trust is present.
REM Depending on this entry point instead of trying to find a python.exe
REM In a subfolder allows you to keep working if the version of python changes or
REM other environmental requirements change.
REM When the project switches to a new version of Python, this file will be updated.
SETLOCAL
SET CMD_DIR=%~dp0
SET CMD_DIR=%CMD_DIR:~0,-1%
SET PYTHONHOME=%CMD_DIR%\runtime\python-3.7.10-rev2-windows\python
IF EXIST "%PYTHONHOME%" GOTO PYTHONHOME_EXISTS
ECHO Python not found in %CMD_DIR%
ECHO Try running %CMD_DIR%\get_python.bat first.
exit /B 1
:PYTHONHOME_EXISTS
SET PYTHON=%PYTHONHOME%\python.exe
SET PYTHON_ARGS=%*
IF [%1] EQU [debug] (
SET PYTHON=%PYTHONHOME%\python_d.exe
SET PYTHON_ARGS=%PYTHON_ARGS:~6%
)
IF EXIST "%PYTHON%" GOTO PYTHON_EXISTS
ECHO Could not find python executable at %PYTHON%
exit /B 1
:PYTHON_EXISTS
SET PYTHONNOUSERSITE=1
"%PYTHON%" %PYTHON_ARGS%
exit /B %ERRORLEVEL%