How do you do this in python with tk?

Ali alikakakhel3 at hotmail.com
Thu Oct 14 16:08:40 CEST 2004


Thank you all!! it now works just fine! The following is the final code!

import Tkinter
def add_rows(w, titles, rows):
    w.configure(state = 'normal')
    for r in rows:
       for t, v in zip(titles, r):
           w.insert("end", "%s:\t%s\n" % (t, v))
       w.insert("end", "\n")
    w.configure(state='disabled')

app = Tkinter.Tk()
t = Tkinter.Text(app, state='disabled')
t.pack()
info = [['Ali',18],
        ['Zainab',16],
        ['Khalid',18]]
add_rows(t, ["Name", "Age"], info)
app.mainloop()

Thank you all again! :):):)



More information about the Python-list mailing list