1 2 3 4 5 6 7 8
import math while(1): s=str(raw_input('>>')) try: print eval(s) except : print 'Invalid Input'
1 2 3 4
>>Traceback (most recent call last): Line 4, in <module> s=str(raw_input('>>')) EOFError