0

Function in database

    con=sqlite3.connect("customer.db")
    cur = con.cursor()
    cur.execute("SELECT * FROM customer")
    row = cur.fetchall()
    con.close()
    return row

Display


customerlist = Listbox(DataFrameRIGHT,width=41,height=16,font=('arial',12,'bold'), yscrollcommand=scrollbar.set)
        customerlist.bind('<<ListboxSelect>>',CustomerRec)
        customerlist.grid(row=0,column=0,padx=8)
        scrollbar.config(command = customerlist.yview)

        def DisplayData():
            customerlist.delete(0,END)
            for row in cstDatabase_BackEnd.viewData():
             customerlist.insert(END,row,str(""))

So Displayed data is not pretty and to do that there is tabulate i guess but i cant figure out how to pass this data and get it to work. Can someone help in getting either tabulate or any other method to display data more tidily?

  • Does this answer your question? [Print tabular formated text into a tk.Text widget, not aligned as its supposed](https://stackoverflow.com/questions/59344319/print-tabular-formated-text-into-a-tk-text-widget-not-aligned-as-its-supposed) – stovfl Apr 18 '20 at 12:54
  • Use `ttk.Treeview` instead of `Text`. Or [tabulate](https://pypi.org/project/tabulate/). – acw1668 Apr 18 '20 at 13:06

0 Answers0