I'm training with Python, learning how to build GUIs.
I made a simple calculator made by 4 functions (+,-,*,/):
def sum(a, b):
c = a + b
return c
def sub(a, b):
c = a - b
return c
def mlt(a, b):
c = a * b
return c
def div(a, b):
c = a / b
return c
My program's CLI is now made like this:
def calc(foo):
try:
if foo == '1':
print('You chose addition. Input the two numbers:')
a = int(input('First: '))
b = int(input('Second: '))
return print('Result is:', sum(a, b))
except:
print('ERROR: Invalid Input')
Full if chain for the CLI is very clumsy and long, and I want to semplify that to my user. Would you give me an example on how I could give this program a GUI using Tkinter?