Advertisement
sclnl

Untitled

Jan 25th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. from guizero import App, PushButton
  2.  
  3. def blink():
  4.         if (blinkingbutton.bg == "black"):
  5.                 blinkingbutton.bg = "white"
  6.                 blinkingbutton.text_color = "black"
  7.         else:
  8.                 blinkingbutton.bg = "black"
  9.                 blinkingbutton.text_color = "white"
  10.        
  11. app = App("blinking button")
  12.  
  13. blinkingbutton = PushButton(app, text="BLINKING BUTTON")
  14. blinkingbutton.bg = "white"
  15. blinkingbutton.text_color = "black"
  16. blinkingbutton.repeat(1000, blink)
  17.  
  18. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement