From: rbenit68 on
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")
From: Tim Roberts on
rbenit68 <rbenit68(a)gmail.com> wrote:
>
>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)

PyReadline on Windows is not identical to readline on Linux, in part
because the low-level operating system interfaces are quite different.
raw_input in the Windows implementation bypasses any readline hooks. You'll
have to use a different method.
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.