0

I'm a Raspberry Pi using Thonny Python's IDE to code, and whenever I try to use a backspace in the form of '\b', it outputs as a check mark: Like this one

I've already looked at some articles on here and only a few mention a GUI bug within Tkinter, but since I'm not using that I'm not sure what's going on. I've also tested it with a simple print('a\b') command in the IDLE, but it still comes out with the check mark following the a.

For reference, I'm using code from this answer: https://stackoverflow.com/a/39504463/11357553

It's specifically this part that produces the oddity:

sys.stdout.write('\b')
sys.stdout.flush()

I'm simply looking to complete the provided function by deleting the most recent character printed to the spinning cursor. I'm rather new and have been able to solve most of my problems, but this one leaves me stuck.

Peter S
  • 1
  • 1

1 Answers1

0

IDLE does not implement a terminal. It does not process either control characters or escape sequences. Run your program in an actual terminal emulator and not via IDLE.

IDLE uses tkinter to implement its GUI. It uses two TK text areas to form the editor and console parts of its windows.

Dan D.
  • 73,243
  • 15
  • 104
  • 123
  • This doesn't help me at all. I don't know what a terminal emulator is and where I might get one on a raspberry pi. Besides, from some quick research it seems this behavior isn't normal for python – Peter S Apr 16 '19 at 03:04