Turtle vs Pygame for Python Games

Once console games feel easy, you'll want graphics. Python beginners usually choose between the built-in turtle module and the popular pygame library. Both are good; they suit different stages.

turtlepygame
InstallComes with Pythonpip install pygame
Learning curveGentle: move, turn, drawSteeper: surfaces, rects, event loop
SpeedFine for small gamesFast, many sprites at 60 FPS
Images and soundBasic shapes and GIF imagesPNG sprites, sound effects, music
Game loopontimer() callbacksYour own while loop with a clock
Best forSnake, Paddle Ball, races, drawingPlatformers, shooters, anything bigger

The same idea in both

A square that moves right every frame. In turtle:

import turtle

screen = turtle.Screen()
box = turtle.Turtle("square")
box.penup()

def frame():
    box.forward(2)
    screen.ontimer(frame, 16)

frame()
screen.mainloop()

And in pygame:

import pygame

pygame.init()
screen = pygame.display.set_mode((600, 400))
clock = pygame.time.Clock()
x = 0
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    x += 2
    screen.fill("black")
    pygame.draw.rect(screen, "white", (x, 190, 20, 20))
    pygame.display.flip()
    clock.tick(60)
pygame.quit()

Our recommendation

Frequently asked questions

Is pygame hard for beginners?

It's harder than turtle because you manage the game loop, events and drawing yourself. If you already know loops, lists and functions, it's very manageable.

Can turtle make real games?

Yes, small arcade games like Snake, Pong-style games, races and simple shooters. For bigger games pygame is faster and more flexible.