import string
+try:
+ raw_input
+except NameError: # Python 3
+ raw_input = input
+
+
def hmenu(prompt, astring):
"""
Writes prompt and read result
result = raw_input(prompt)
try:
- result = string.atoi(result)
- except string.atoi_error:
+ result = int(result)
+ except ValueError:
result = -1
return result