Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from guizero import App, PushButton
- def flip_color():
- if app.bg == "white":
- app.bg = "black"
- else :
- app.bg = "white"
- def stop_flip():
- app.destroy()
- app = App("Flip Colour", bg="white")
- btn_start = PushButton(app, command=flip_color, text='Recolorize')
- btn_stop = PushButton(app, command=stop_flip, text='Stop It')
- app.repeat(5000, flip_color)
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement