planetthoughtful wrote:
> I'm wondering if it's possible, using raw_input(), to provide a
> 'default' value with the prompt?
>
def get_input_with_default(default, prompt=">>> "):
    result = raw_input('['+str(default)+'] '+str(prompt))
    if result == "": result = default
    return default

> I would like to include the ability to edit an existing value (drawn
> from an SQLite table) using a DOS console Python app, but my gut
> feeling from reading what I can find about raw_input() is that it only
> allows you to provide a prompt, not a default value as well.
>
I think it is the editing part that is going to give you a hard time.
curses and readline might be some help if you were on a Unix platform.
I can't think of any way to provided a editable  value at the dos
prompt.  

All the best,
 Keir.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to