def showdata(self):
sender=self.sender()
self.statusBar().showMessage(sender.text()+' was pressed.')
with sqlite3.connect('database.db') as db:
cursor=db.cursor()
cursor.execute('select* from Item Order BY Name ASC')
product=cursor.fetchall()
product=str(product)
print(len(product))
self.l.setText(str(product)) #this prints the database headers to a label inside my gui
self.l124.setText(show) #this prints the database rows to a label inside my gui
This calls to my sqlite database and print all the data out in brackets in one line, such as (2, 'test', 'test', 'test', 'test', 'test', 'test', 'test')], with 2 being the unique id, and the other values input by the user. It also print out the database headers, separately to the rows, I would like to have them together to add simplicity. If any more information is required to aid me with my problem, or any code, please let me know.