Skip to content
Advertisement

How can I convert a return statement into something that can be used by Tkinter [closed]

I am making a GFC (Greatest Common Factor) calculator with GUI, but my current code only works with a return statement, and tkinter doesn’t accept return to fill a textbox widget.

Here is a sample of my code

JavaScript

Here is where it’s supposed to be used: (To fill GE3)

JavaScript

How do I convert a return statement into something that can be used by Tkinter?

Advertisement

Answer

You can just insert the result into the text box inside gprocess():

JavaScript

Note that there is math.gcd() to find the GCF.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement