0

Okay so I'm writing a commandline program in python using the Rich library for my UI basically. Now I've written a method that changes the color of the program logo (Text) every second to create a simple RGB animation. Now when I run the animation using a Thread, because the animation is in an infnite loop, I cant close the program even after using Ctrl+C. It just keeps playing the animation except I close the terminal in PyCharm. But when I use a process instead, everything works fine. So my question is, what am I supposed to use to do the animation task according to good programming ethics. And if I'm supposed to use a Thread, what am I doing wrong? And what am I supposed to do to so I can close the program when I want to.

By the way I already tried animationThread.join() but I guess it didn't work because the main thread was still waiting for the infinite loop to finish

0 Answers0