Different methods are mentioned here, https://stackoverflow.com/questions/1489669/how-to-exit-the-entire-application-from-a-python-thread
os._exit is given as one of the replies. "should normally only be used in the child process after a fork()"
But since this was for my smart lamps scripts, did not implement any of this.
Edit - Also see my updated post on the python script, which allows us to just hit ctrl-c to interrupt - https://hnsws.blogspot.com/2023/10/redesigning-python-code-to-fade-out.html
No comments:
Post a Comment