Re: Passing back the ERRORLEVEL

2018-12-29 Thread eryk sun
On 12/28/18, Gisle Vanem wrote: > I have trouble understanding why a 'sys.exit(2)' is > *not* passed back to the CMD shell in this little example: > > - c:\py_cmd_test.cmd -- > @%WinDir%\py.exe -2 -x %~dp0py_cmd_test.cmd & exit /b %ERRORLEVEL% %ERRORLEVEL% gets expanded in the initial

Passing back the ERRORLEVEL

2018-12-28 Thread Gisle Vanem
I have trouble understanding why a 'sys.exit(2)' is *not* passed back to the CMD shell in this little example: - c:\py_cmd_test.cmd -- @%WinDir%\py.exe -2 -x %~dp0py_cmd_test.cmd & exit /b %ERRORLEVEL% # The '-x' is for Python to skip the 1st line of this file. import sys print ("Hello,