-1

I am struggling to get the Turtle module to respond (change shape, color etc.) whilst using PyCharm. I am following a Udemy course and I believe I am using the correct code to change the attributes but to no avail. Any advice would be greatly appreciated. I have attached a screenshot of the code and GUI box.enter image description here

I believe I have imported the Turtle module correctly and have used the correct syntax to change the shape and color of the turtle. No success so far.

ggorlen
  • 44,755
  • 7
  • 76
  • 106
  • Does this answer your question? [Python Turtle.Terminator even after using exitonclick()](https://stackoverflow.com/questions/45534458/python-turtle-terminator-even-after-using-exitonclick) – ggorlen Feb 25 '23 at 02:11
  • [Why should I not upload images of code/data/errors?](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors) – ggorlen Feb 25 '23 at 02:12

2 Answers2

0

The exitonclick method starts the GUI's mainloop, which means all the lines that come after will not be executed until the GUI is closed.

The solution would be to simply move the exitonclick line to the last line of your script:

from turtle import Turtle, Screen

aubree = Turtle()
my_screen = Screen()

aubree.shape("turtle")
aubree.color("coral")

my_screen.exitonclick()
Alexander
  • 16,091
  • 5
  • 13
  • 29
0

You should move your my_screen.exitonclick() to the very end of the program. So, like this:

from turtle import Turtle, Screen
aubree = Turtle()
my_screen = Screen()

aubree.shape("turtle")
aubree.color("coral")

my_screen.exitonclick()
Ria
  • 1
  • 1