Running Pygame Zero in IDLE and other IDEs

Pygame Zero is usually run using a command such as:


Certain programs, such as integrated development environments like IDLE and Edublocks, will only run python, not pgzrun.

Pygame Zero includes a way of writing a full Python program that can be run using python. To do it, put

import pgzrun

as the very first line of the Pygame Zero program, and put


as the very last line.


Here is a Pygame Zero program that draws a circle. You can run this by pasting it into IDLE:

import pgzrun

WIDTH = 800
HEIGHT = 600

def draw():
    screen.clear(), 300), 30, 'white')