When debugging a script and encountering a runtime error 'ipy.exe' closes before the error can be read and understood.
Within Visual Studio this can be fixed.
To do this, right click your project within Visual Studio -> Properties -> Debug -> Add -i to "Interpreter Arguments"
Similarly, in PyCharm edit the Run Configuration and add -i to "Interpreter Arguments"