Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from guizero import App, PushButton, Text
- def buttonflash():
- if button.bg == "black":
- button.bg = "white"
- else:
- button.bg = "black"
- app = App("Flashing Button")
- text = Text(app, text="Here is a flashing button")
- button = PushButton(app, text="Push Button")
- button.bg = "black"
- button.repeat(1000, buttonflash)
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment