Reputation: 1
I am currently working on a game in python using the turtle
library import. Before I add anything to the main game always test it in another python file to make sure it works.
I came across the turtle.textinput()
It worked in my test code but not in my actual game. When I tried to put it in the actual game it says
AttributeError: type object 'Turtle' has no attribute textinput
This makes no sense. I use VS code so I don't understand what is going on please help
P.S. : I couldn't figure out the code highlight thing so I put it in brackets.
Upvotes: 0
Views: 428
Reputation: 41
Note that textinput()
is a method in the Screen
instance, and not in the turtle.
from turtle import Screen
screen = Screen()
screen.textinput("Title Example", "Prompt example")
Upvotes: 0