()
| 41 | return l |
| 42 | |
| 43 | def calculate(): |
| 44 | text = textin.get() |
| 45 | for word in text.split(' '): |
| 46 | if word.upper() in operations.keys(): |
| 47 | try: |
| 48 | l = extract_from_text(text) |
| 49 | r = operations[word.upper()](l[0], l[1]) |
| 50 | list.delete(0,END) |
| 51 | list.insert(END,r) |
| 52 | except: |
| 53 | list.delete(0,END) |
| 54 | list.insert(END,'something went wrong please enter again') |
| 55 | finally: |
| 56 | break |
| 57 | elif word.upper() not in operations.keys(): |
| 58 | list.delete(0,END) |
| 59 | list.insert(END,'something went wrong please enter again') |
| 60 | |
| 61 | operations = {'ADD':add,'ADDITION':add, 'SUM':add, 'PLUS':add, |
| 62 | 'SUB':sub, 'DIFFERENCE':sub, 'MINUS': sub, 'SUBTRACT':sub, 'DIFF':sub, |
nothing calls this directly
no test coverage detected