Skip to content

Get started

You need three things: Python 3.11 or newer, a terminal, and a few minutes.

1. Install

In a terminal, in the folder where you keep your sketches:

python -m venv .venv
.venv\Scripts\activate        # Windows;  on macOS or Linux:  source .venv/bin/activate
python -m pip install funground

This installs funground 0.1.0, the latest release. A few pages of the guide and the gallery are marked Since 0.2: those things work in Play now, and come to your computer with funground 0.2.

On Linux, install the Cairo library first. On Debian or Ubuntu that is sudo apt install libcairo2-dev pkg-config python3-dev.

2. Run a sketch

Save this as first.py and run it with python first.py:

import funground as f


def setup():
    f.size(640, 400)


def draw():
    f.background("white")
    f.fill("tomato")
    f.circle(f.mouse_x, f.mouse_y, 80)


f.run()

A window opens. The circle follows your mouse. Press Escape to stop.

setup() runs once. draw() runs again and again, about sixty times a second. That is all a moving picture is: the same drawing, repeated, a little different each time.

3. Keep going