A fun and advanced Paint-like application written in Python using the graphics.py library.
This project allows you to draw lines and various shapes (circle, square, rectangle, triangle), change colors, adjust pen size, clear the canvas, and quit the program.
It’s an interactive way to practice Python graphics programming and create your own mini Paint app!
The Advanced Paint App is designed for users who want a richer drawing experience.
It uses John Zelle’s graphics.py library to provide a canvas where users can draw lines, shapes, and experiment with colors and pen sizes.
Users can interactively:
- Draw lines by clicking and dragging the mouse.
- Draw circles, squares, rectangles, and triangles by selecting the shape key.
- Change pen color randomly.
- Adjust pen thickness.
- Clear the canvas while keeping instructions visible.
- Quit the program at any time using a key.
- Draw lines with mouse drag.
- Draw shapes: Circle (
O), Square (S), Rectangle (R), Triangle (T). - Change pen color randomly with
C. - Increase/decrease pen size with
+or-. - Clear the canvas with
X(info text remains). - Quit the program with
Q. - Display current shape, color, and pen size at the top of the window.
- Make sure you have Python 3 installed.
- Install the
graphics.pylibrary:
pip install graphics.pyNote:
graphics.pyis John Zelle’s simple graphics library for Python.
Run the program:
python paint.py| Action | Key / Mouse |
|---|---|
| Draw line | Click and drag mouse |
| Draw circle | O |
| Draw square | S |
| Draw rectangle | R |
| Draw triangle | T |
| Change color | C |
| Increase pen size | + or = |
| Decrease pen size | - |
| Clear canvas | X |
| Quit | Q |
- Keep clicking and dragging to draw continuous lines.
- Use
Cmultiple times to cycle through different colors. - Adjust pen size to create thin or thick shapes.
- Shape selection only affects the next click; you can switch between shapes anytime.
This project is open-source and free to use.