Skip to content
Sign upLog in
← Back to Community

Console input broken after turtle drawing

Profile icon
PaulWallich

I've got students who are trying to do simple turtle graphics programs and came across what seems to be a weird bug. After the repl has opened a turtle window, typing in the console produces garbage results. If I type a function name (function defined in the repl), I get NameError and whatever the function name is not defined in line 1. If I type return, I get "No module named at ".

I know that running turtle graphics locally sometimes leads to window focus weirdness, but this looks as if the console is completely disconnected from anything useful

Voters
Profile icon
ImmaSofia
Profile icon
PaulWallich
Comments
hotnewtop
Profile icon
Coder100

Try changing the repl language to pygame, you can still write in python turtle, as it is just python, but it has less bugs. Python turtle is I think interpreted differently than python.

Profile icon
PaulWallich

@Coder100

I did some more messing around, and this seems pretty close to the answer. A python-with-turtle repl apparently isn't a real python repl plus turtle graphics, it's a stripped-down repl that is limited to mostly running single turtle programs. If you just do a regular python repl and then import turtle as your first line, repl.it creates a graphics sub-window and does the turtle stuff in it. And then you have a console you can type at. Thanks!

Profile icon
RYANTADIPARTHI

Either you have make a instance of it first, or refresh.

Profile icon
TalinSharma

To use a function call it in the program - function_name(). Not while the program is running. Mark this correct if this helped!

Profile icon
InvisibleOne

I don't really know turtle, but if you think it is a bug report it