File associations on my machine (winxp home) are such that a python script is directly opened with the python interpreter. If I double click on a python script a console window runs and every thing is fine - as long as there is no syntax error in the script.
In that case the console window opens up for a moment but it is closed immediately. Too fast to read the error message.
Of course their would be the possibility to manually open a console window and to execute the script by typing python myscript.py
but I am sure that there is a more convenient (i.e. "double click based") solution.
Make a batch file:
C:\Python26\python.exe %1
IF %ERRORLEVEL% NEQ 0 PAUSE
Use that as your file association instead of python.exe directly. This will only cause the PAUSE statement to execute if python.exe returns an error
The canonical way to run a command in a command prompt window that doesn't close is
cmd /k "your command"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With