0

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

4
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by G_S
0

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 by griswolf: n/a

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.