Adding an image to the turtle screen

How to add an image to mine Turtle Screenusing a turtle?

whenever I use a function addshape, I get errors all the time.

did turtle graphics get any other way to load / import images?

eg:

import turtle

screen = turtle.Screen()

image = r"C:\Users\myUser\Desktop\Python\rocketship.png"

screen.addshape(image)
turtle.shape(image)
+4
source share
1 answer

The module turtlehas image support, but only GIF images, not PNG or any other format. As the docs addshapesay:

name is the name of the gif file, and the form None: set the appropriate image form.

, "gif ": , data.lower().endswith(".gif"), , , .png.

, , Tkinter , , PPM/PGM/PBM, PNG. PNG , Pillow.

, turtle. ( , ), .png .gif, .

+5