repl.it
@glench/

Repl.it Play async/await example

Pygame

A simple template for making Python Play projects.

fork
loading
Files
  • main.py
  • nohup.out
  • Packager files
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
import play # this is the first line in your program

@play.repeat_forever
async def do():
  play.set_backdrop('red')
  await play.timer(seconds=1)
  play.set_backdrop('green')
  await play.timer(seconds=1)
  play.set_backdrop('blue')
  await play.timer(seconds=1)

play.start_program() # this is the last line in your program
?