the code below will not execute the except section when i enter a
number.
what am i missing ?

#########################################
.while 1:
.   print 'Pump Protection ? '
.   #line 133
.    try:
.        myInput = raw_input('A B C D E F G H I J K L ? ')
.        myInput = string.upper(myInput)
.        if myInput == 'A':break     #
.        if myInput == 'B':break     #
.        if myInput == 'C':break     #
.        if myInput == 'D':break     #
.        if myInput == 'E':break     #
.        if myInput == 'F':break     #
.        if myInput == 'G':break     #
.        if myInput == 'H':break     #
.        if myInput == 'I':break     #
.        if myInput == 'J':break     #
.        if myInput == 'K':break     #
.        if myInput == 'L':break     #
.    except ValueError:
.         print "Oops! That was no valid number.  Try again..."
.         pass


.'s are to preserve indents.
fred

-- 
http://mail.python.org/mailman/listinfo/python-list
  • Re: try /... '@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])])
    • Re: ... Robert Kern
    • Re: ... Brian van den Broek
    • Re: ... '@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])])

Reply via email to