How do you do this in python with tk?
alikakakhel3 at hotmail.com
Fri Oct 8 18:49:49 CEST 2004
Jeff Epler <jepler at unpythonic.net> wrote in message news:<mailman.4538.1097192656.5135.python-list at python.org>...
> You could create a Text widget and insert lines of text in it.
> import Tkinter
> def add_rows(w, titles, rows):
> for r in rows:
> for t, v in zip(titles, r):
> w.insert("end", "%s:\t%s\n" % (t, v))
> w.insert("end", "\n")
> app = Tkinter.Tk()
> t = Tkinter.Text(app)
> info = [['Ali',18],
> add_rows(t, ["Name", "Age"], info)
> If there are many lines, you can use a scrollbar widget to scroll the
> text widget. You can use the tabs= argument of the Text widget to
> adjust the alignment of the second column. If you want to make the
> items "interactive", you can use tags and tag_bind to react to things
> like button presses. You can set the text widget to be "disabled" to
> keep the user from changing the contents.
I will try out your code. Thank you for helping.
More information about the Python-list