pyreadline: default editable input; please, help.

R

rbenit68

I would like to run this minimal example: I get the prompt
(Question?), but not the 'default editable signal'. Please ¿any hints?
(Windows XP-SP3, Python 2.6, pyreadline 1.5)

import readline

def input_default(prompt, default):
def startup_hook():
readline.insert_text(default)
readline.set_startup_hook(startup_hook)
try:
return raw_input(prompt)
finally:
readline.set_startup_hook(None)

print input_default("Question?", default="default editable answer")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,477
Latest member
ColumbusMa

Latest Threads

Top