Knowledge Base‎ > ‎Programming‎ > ‎Python‎ > ‎Python Reference‎ > ‎Python Reference‎ > ‎







 Called directly after setup() and continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called.

The draw() function is called automatically and should never be called explicitly. It should always be controlled with noLoop(), redraw() and loop().

After noLoop() stops the code in draw() from executing, redraw() causes the code inside draw() to execute once and loop() will causes the code inside draw() to execute continuously again.

The number of times draw() executes in each second may be controlled with the delay() and frameRate() functions. There can only be one draw() function for each sketch and draw() must exist if you want the code to run continuously or to process events such as mousePressed().