In the console you can print "\b"
to erase the character left of the cursor (backspace) like this
print "the last char is going to be erased\b" # the last char is going to be erased
How to just move one position to the left instead of erasing (left arrow)?
It depends on the terminal type and connection, but you can usually assume ANSI cursor movement, so cursor-left is ESC + '[' + 'D':
print "The cursor should be between the arrows: -> <-\e[D\e[D\e[D"
readline
See http://ascii-table.com/ansi-escape-sequences.php for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With