Ask coding questions

← Back to all posts
Why doesn't the input() method work anymore in Python (with Turtle)?
ChristopherBurn (7)

It worked yesterday. It still works in regular Python. All of a sudden, when I call input(), it seems to just freeze the program. It allows me to press enter, but it doesn't do anything with the input even when I save it to a variable and call it later. I can't even print the input.

I can't find anywhere to report a bug, so here we are.

myText = input()
print (myText)
#This will work in Python, but not Python (with Turtle)

InvisibleOne (2979)

I've heard some say that it only works if you put it before your draw anything, but I just made a test repl and input wouldn't work, although I'm sure that I've had it working before.
It doesn't work in the console:

But if you go to the shell tab (you might need explorer turned on) and run it from there, then it does work, I'm not sure why.

InvisibleOne (2979)

I figured it out, and the answer was pretty obvious, just put your code in a normal python repl, it will open a graphics window and run just find, and let you use input.

ChristopherBurn (7)

@InvisibleOne I know that works, but I have students building a game who want to use the turtle, but take user input off console.

InvisibleOne (2979)

Yeah, and they can use turtle, just put all your turtle code in a normal python repl, and you can still do everything turtle. @ChristopherBurn

JamesGordon1 (150)

Hi can you please update your post to include the repl you are referring to that way we can help to solve this problem?