Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time

Python Text Based Graphics Module

This is a console based python3 graphics engine for simple Unicode games or animations.,,, and are example programs using the module (Note: < and > are used instead of arrow keys.), also see grit96's Physics Engine and my Tetris game, which use this module.


Install using

python3 install

Or install from PyPI:


Simple usage example:

import graphics as g

# Create the canvas, 20x20 pixels (characters).
screen = g.Canvas(size = (20, 20))

# Create a circle image, radius 5 pixels.
circleImage = g.shapes.Circle(5)

# Create a green sprite at position (7, 7) with the circle image.
circleSprite = g.Sprite(circleImage,
                        position = (7, 7),
                        color = g.colors.GREEN)

# Add the sprite to the canvas.

# Output the canvas to the terminal.

# Increase the circles radius by two.
circleSprite.image.radius += 2

# Output the canvas to the terminal.


This module was written and tested with python3 on Debian with gnome-terminal. It should work with most Linux terminals, but some things might be off.

  • Colours should work if your terminal supports them, otherwise they won't cause any problems.
  • The input module supports Windows, Mac and Unix. Linux works fine and testing is in progress for Windows.
  • In the Windows CMD it doesn't centre properly, colours don't work, it was slow and input doesn't work. is a small script to determine the terminal size. Works in my gnome-terminal in Debian, probably wont work in all environment. It was modified from Stack Overflow. has functions for adding the correct escapes to strings to color them, modified from a blog, also not sure about environment support. an object to get non blocking input in the terminal, this only works in Linux terminals. This was modified from

Bitdeli Badge

You can’t perform that action at this time.