is_running#

Boolean value reflecting if the Sketch is in the running state.

Examples#

 1import time
 2
 3def setup():
 4    py5.background(255, 0, 0)
 5
 6
 7print("the sketch is ready:", py5.is_ready)
 8
 9py5.run_sketch()
10
11print("the sketch is running:", py5.is_running)
12
13py5.exit_sketch()
14
15# wait for exit_sketch to complete
16time.sleep(1)
17
18print("the sketch is dead:", py5.is_dead)
19print("did the sketch exit from an error?", py5.is_dead_from_error)

Description#

Boolean value reflecting if the Sketch is in the running state. This will be False before run_sketch() is called and True after. It will be False again after the Sketch has exited.

Updated on March 22, 2022 21:53:01pm UTC