Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. from guizero import App, Box, Picture, PushButton, Text
  2.  
  3.  
  4.  
  5. def change_colour():
  6. if mybutton.bg=="black":
  7. mybutton.bg="white"
  8. else:
  9. mybutton.bg="black"
  10.  
  11.  
  12. app=App("a flashing button")
  13.  
  14. mybutton=PushButton(app, text="tick tock", command=change_colour)
  15.  
  16.  
  17. mybutton.repeat(1000,change_colour)
  18.  
  19. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement