Jun-27-2024, 01:58 PM
I have a window that is live updating with rows, but it only adds rows. I'd like to delete the old rows each refresh so that it appears as a live table. Heres what I have so far:
filename = 'exampleFile.csv'
#this keeps adding rows; need to delete rows at end of cycle
while(1):
with open(filename, 'r') as file:
reader = csv.reader(file)
for row in reader:
##value = row
#this adds the rows, need to delete afterwards
self.table.addItem(f'among ', f'{row}')
time.sleep(1)
self.update()
time.sleep(1)
file.close()I've tried "del row" but that obviously just deletes the rows from the reader object instead of deleting the items from the table. There doesn't seem to be a clean way to remove items from the table?
