code sample: ---------------------------------------------- i=input() try: x=int(i) print "you input an integer" except ValueError: print "you must input an integer" ------------------------------------------------ when I input a value like, b I got the traceback message instead of proper exception handling:
NameError: b is not defined I also tried ------------------------------------------ try: x=int(i) except ValueError: print "something" except NameError: pting "something" else: print "something" ---------------------------------------------------- It still couldn't capture the exception, just the same traceback error msg. I'm really confused, any suggestions please? -- http://mail.python.org/mailman/listinfo/python-list