Tkinter int() error. pls help!!!!!!
Can you pls tell wut's wrong with my code? Everythings fine but I get an error.
Basically the error is that
c.get() has the value of
'' which is not an int.
What you should do instead is to have a try except statement like this:
def convert(): try: result = int(c.get()) / 5 * 8 + 32 + " Fahrenheit" r['text'] = result except: r['text'] = 'ERRRORRORORROOROROROROOROR'
that way you can also reliablely and gracefully handle bad input that is not number