Providing 'default' value with raw_input()?

Noah noah at noah.org
Thu Dec 22 19:15:21 CET 2005


So you are saying that something like this would not work for you?

    current_record_value = get_value_in_database ('record_key')
    new_record_value = raw_default ("Enter new record value",
current_record_value)
    set_value_in_database ('record_key', new_record_value)

Maybe you are confusing this with TAB completion at the shell command
line.

I often use my own default_input function. I also add the ability to
HELP text
to the prompt, so if the user enters '?' then extra information is
printed.
Of course, that means 

Yours,
Noah




More information about the Python-list mailing list