Hi,

a simple question: how do I enable deleting inside a python program?

I have a python program that asks for user input, users write some words and then press enter. The problem is they can't use backspace or supr to delete anything, instead, the program prints ^? each time they press backspace. Any ideas?


I use python 3.x and the readline libraries are working perfectly in the terminal program I use for running these scripts.


thank you

Data point:
(Python 3.1.2, OS/X latest)
From the command line I invoked python3 and entered this code print(input("What: ")) All the usual cursor controls worked for me: Delete, emacs-style commands (^A ^B, ^D ^E and ^F), arrows all did as I expected.

Edited 6 Years Ago by griswolf: n/a

Yes, you are right. The problem was in the terminal program I was using, not python. I solved it by switching to Konsole.


Thank you all.

This question has already been answered. Start a new discussion instead.