Quits/stops/exits the program.


def draw():
    py5.line(py5.mouse_x, py5.mouse_y, 50, 50)

def mouse_pressed():


Quits/stops/exits the program. Programs without a draw() function stop automatically after the last line has run, but programs with draw() run continuously until the program is manually stopped or exit_sketch() is run.

Rather than terminating immediately, exit_sketch() will cause the Sketch to exit after draw() has completed (or after setup() completes if called during the setup() function).

For Python programmers, this is not the same as sys.exit(). Further, sys.exit() should not be used because closing out an application while draw() is running may cause a crash (particularly with P3D).

Underlying Processing method: exit


exit_sketch() -> None

Updated on September 01, 2022 16:36:02pm UTC