value = input_raw("What is the number?")
while not isinstance(value, int):
try:
value = int(value)
except ValueError:
value = input_raw("What is the number?")
In other words, get the text input, and then keep trying to convert it
to an int while asking for input again if that conversion fails. Stop
trying this when `value` is seen to be an integer.
--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing:
http://www.twitter.com/ironfroggy