Guys everytime I use time.sleep() my program misbehaves and I needed to delay my program for a few seconds before proceeding what can I do
I imported time and my program started to hang I cant even click on the button when I used window.sleep I was creating a bank program and I wanted to change the color of the display text to red when someone tries to withdraw an amount that is greater than the balance then the program should sleep for a few seconds then turn the text back to green.
You can use the
aftermethod, which schedules code to be run in the future.In the following example, when you click the button the text will turn red, then 5 seconds (5000 milliseconds) later it will turn green.