Python Turtle using images
MartinOHanlon1 (2)

I wanted to use images with the Python turtle to set the turtle to be a different shape e.g.


Unfortunately I couldnt find a way of adding images to a Python turtle project. Is this something which is supported?

You are viewing a single comment. View All
PYer (3226)


import turtle
screen = turtle.Screen()
image = "rocketship.png"

Just note that you need to do both the screen.addshape() and turtle.shape(), to set the shape of the turtle.
This wasn't part of your question, but you might want to know how to do this. You can change the background image of the screen to, as shown in this example.

import turtle
screen = turtle.Screen()
screen.setup(400, 400)

Make sure to set the screen.setup() size to the same size as your image. Otherwise, there will be white space around the edges.

Please upvote this comment if it was helpful or useful in anyway. Thank you!

mat1 (3270)

@fullern000 Hey, this won't work since Turtle doesn't work with multiple files

Please upvote this comment if it was helpful or useful in any way. Thank you!

PYer (3226)

@mat1 We should tell timchen about this. So that he can allow it. And also couldn't you enter the image url