[Tutor] Questions about shelve

Kalle Svensson kalle@gnupung.net
Tue, 23 Oct 2001 22:21:06 +0200


[Jackson]

> 2. Change "end_of_field" char to Ctrl+a to allow multi line imput for
> problem and resolution fields.

Try something like this function:

def get_input(prompt):
    lines = []
    while 1:
        s = raw_input(prompt)
        if s == ".":
            break
        lines.append(s)
    return "\n".join(lines)

End input with a . on a line by itself, like

Prompt: Hello!
Prompt: 
Prompt: Fish.
Prompt: .

Peace,
  Kalle
-- 
[ Thought control, brought to you by the WIPO! ]
[ http://anti-dmca.org/ http://eurorights.org/ ]