I have the following code:
num = int(raw_input("input number: "))
print "\b" * 20
The console output looks like
input number: 10
I’d like to delete the text input number: 10 after the user presses ENTER. The backspace key \b can’t do it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This will work in most unix and windows terminals … it uses very simple ANSI escape.
Please note that on Windows you may need to enable the ANSI support using the following
http://www.windowsnetworking.com/kbase/windowstips/windows2000/usertips/miscellaneous/commandinterpreteransisupport.html
“\033[A” string is interpreted by terminal as move the cursor one line up.