0

I'm trying to create a basic calculator with Tkinter.

Basically the user types in the radius of a circle and then it should print out the diameter, circumference and the area of the circle.

I've been experimenting with Entry() and .get() but yeah i haven't found out anything yet about my problem.

Thanks a lot.

rioV8
  • 24,506
  • 3
  • 32
  • 49
Prime
  • 1
  • 4

1 Answers1

1

I think you're looking for something like this:

radius = tk.DoubleVar()
radius_entry = ttk.Entry(root, textvariable=radius)
radius_entry.pack()

Then if you run radius.get() you get the current entry.

You can also track when the input changes with trace: https://www.geeksforgeeks.org/tracing-tkinter-variables-in-python/

I recommend taking a look at an online tutorial for learning tkinter to get more information. This tutorial helped me a lot when I started tkinter: https://www.pythontutorial.net/tkinter/

Rik Mulder
  • 245
  • 1
  • 9