Postgresql While Loop Exit Python Interpreter Visual Studio