'How to make all python threads that are created from the main thread are daemon threads?

I use a lot of libraries that create their own threads. I want to all threads stop when the main tread is down. Basically, I want that all threads should be a daemon thread. Potentially, I could rewrite all libraries and make them create daemon threads, but it will take a huge amount of time.

So my question is, Is there is a way how to make all threads are daemon threads?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source