I use spyder IDE and my program is unable to stop after the set hours. Its not causing any harm, but since spyder shows the values of the variables after a program stops, it helps in debugging. So far I have only been able to debug because I log everything. But this approach has its limits.
Now it does exit using sys.exit() BEFORE it hits kws.connect(). As soon as it hits, sys.exit() is essentially ineffective and the error is "builtins.SystemExit: ". I know it says in the documentation that kws.connect() is basically like an infinite loop, but there must be a way to exit the program.
I do use we.close() to close the connection, that part is ok. But as you know it does not exit the program.