I'd like to make a graphic window in PyDev (Eclipse) python 2.75.
I've done few things but I'd like to make an "entrance" "blink". It's Tests the user input.
If it's an integer it should blink green for a second, and then turn into white. But if it's a string of something else it should blink red, and then turn into white. I've used a time.sleep()
but it doesn't work as I'd like to.
Here is my code for this action:
def sprawdzam():
z = e.get()
try:
z = int(z)
e.config(bg = 'green')
time.sleep(2)
e.config(bg = 'white')
except:
l.config(bg = 'red')
time.sleep(2)
e.config(bg = 'white')
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…