python code to display a grid of data table

Solutions on MaxInterview for python code to display a grid of data table by the best coders in the world

showing results for - "python code to display a grid of data table"
Habiba
13 Sep 2016
1try:  from tkinter import *  from tkinter.ttk import *except ImportError :    print("exception in importing module")
2class MyWindow(Frame):
3
4
5
6
7    def CreateUI(self):        tv = Treeview(self)        tv['columns'] = ('Name', 'Mobile', 'course')        tv.heading("#0", text='RollNo', anchor='w')        tv.column("#0", anchor="w")        tv.heading('Name', text='Name')        tv.column('Name', anchor='center', width=100)        tv.heading('Mobile', text='Mobile')        tv.column('Mobile', anchor='center', width=100)        tv.heading('course', text='course')        tv.column('course', anchor='center', width=100)        tv.grid(sticky = (N,S,W,E))        self.treeview = tv        self.grid_rowconfigure(0, weight = 1)        self.grid_columnconfigure(0, weight = 1)root = Tk()MyWindow(root)root.mainloop()
8