Skip to content Skip to sidebar Skip to footer

How Can I Create A List Of Entries In Tkinter

My problem at the moment is that I have entries which will be filled out by the user but I am trying to store them in a list so that it makes it easier to do maths using things lik

Solution 1:

Store the widget references in a list:

import Tkinter as tk
...
entries = []
for i in range(10):
    entry = tk.Entry(...)
    entries.append(entry)

later, when you need the values you can iterate over the list:

values = [int(entry.get()) for entry in entries]

Post a Comment for "How Can I Create A List Of Entries In Tkinter"