0

I am using raw_input() like this:

while True:
  print "MC ID (CTRL-D = done, 0 = sets, ? = lookup):",
  try:
    mcid=raw_input()
  except:
    print
    break
  # evaluate user input
  # ...

Now if you type something, e.g. abc and hit backspace to correct something, as soon as you remove the a, the output from print is erased as well (and the cursor jumps to the beginning of the line), so that you no longer see the input prompt. Is there a way to avoid this?

fuenfundachtzig
  • 7,952
  • 13
  • 62
  • 87

2 Answers2

4

Try this:

mcid = raw_input("MC ID (CTRL-D = done, 0 = sets, ? = lookup): ")
Perception
  • 79,279
  • 19
  • 185
  • 195
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
1

I cannot reproduce it, but you can try this way:

mcid=raw_input("MC ID (CTRL-D = done, 0 = sets, ? = lookup):")
Michał Šrajer
  • 30,364
  • 7
  • 62
  • 85