Terminals vary in their capabilites of handling such special characters. A similar question was answered by Wayne Werner, who said that IDLE just does not handle those special characters (i.e. printing a stand-in character, rather than moving the cursor or deleting.), which may be for good reason.
Short of writing a patch as Wayne mentioned, you may find that running your program in the native terminal does work as expected. (i.e. python path/to/your/program
).
From Comments
If you would like the program to be aware of it's environment (as was asked in the comments) it is possible (and perhaps most simple) to create a command line switch that is set manually at the program's execution. If you launch from a shortcut or another program (perhaps a batch file) you could automate the process by incorporating it into the pre-written command.
Such a switch could look like:
python path/to/your/program --terminal //For a full terminal
python path/to/your/program --IDLE //For IDLE
Note
After reading Terry Jan Reedy's comment, I'd to point out that his guidance toward tkinter(and on the general facets of this situation) may in fact be the most helpful for a thorough solution to the issue. Check those comments out.