Advertisement
Buzzbow

flashing gutton timer

Aug 25th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. from guizero import App, PushButton, Text
  2.  
  3. def toggle_background_color():
  4.  
  5. if button.bg == "black":
  6. button.bg = "white"
  7. else:
  8. button.bg = "black"
  9.  
  10.  
  11.  
  12.  
  13. app = App()
  14. button = PushButton(app,text = "one second")
  15. button.bg = "black"
  16.  
  17. button.repeat(1000, toggle_background_color)
  18.  
  19. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement