Tkinter: Dynamic entry widget

Arne arnemeissner at gmx.de
Tue Apr 25 12:32:40 EDT 2006


Hello !

I want to create entry widgets dynamically.
var = ["one", "two", "three"]
i=0
for x in var:
    textbox = "t_", x
    textbox = entry(frame)
    textbox.grid(row=4+i, column=0)
    i = i + 1
This works ok. On the window are the entries like I want.

When I want to get to entered data from the entry widget. I am not able to 
get them.
The statement: t_one.get()
dosent work. I am getting an error message that t_one is not global defined.

How can I do this?

Arne





More information about the Python-list mailing list