Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import play
- from random import randint
- button123 = play.new_box("red", 0, 0, 300, 100)
- text = play.new_text("Я первый текст", 0, 0, None, 40)
- @play.when_program_starts
- def start():
- pass
- @play.repeat_forever
- def do():
- pass
- # Событие клика по объекту button123
- @button123.when_clicked
- async def click():
- # Свойство words отвечает за текст, показываемый на экране
- text.words = randint(0, 10)
- # Задержка программы на 5 секунд (ОБЯЗАТЕЛЬНО await) -> ФУНКЦИЯ ОБЯЗАТЕЛЬНО async
- await play.timer(5)
- text.words = "Я первый текст"
- play.start_program()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement