Added something(prompt).

This commit is contained in:
Jeremy Fincher 2003-04-08 07:22:40 +00:00
parent 822a12535b
commit 2047dd76b6
1 changed files with 7 additions and 0 deletions

View File

@ -47,6 +47,13 @@ def expect(prompt, possibilities, recursed=False):
def anything(prompt):
return expect(prompt, [])
def something(prompt):
s = expect(prompt, [])
while not s:
print 'Sorry, you must enter a value.'
s = expect(prompt, [])
return s
def yn(prompt):
return expect(prompt, ['y', 'n'])