def rlinput(prompt, prefill=''):
    readline.set_startup_hook(lambda : readline.insert_text(prefill))
try:
    return input(prompt)
finally:
    readline.set_startup_hook()
Show default value for editing on Python input possible?