def save_file(self): fs = QtGui.QFileDialog.getSaveFileName(self, 'Сохранить', '', 'CSV(*.csv)') if fs: with open(fs, 'w') as stream: writer = csv.writer(stream) for x in range(self.table.rowCount()): row = [] for y in range(self.table.columnCount()): item = self.table.item(x, y) if item is not None: row.append(item.text()) print(row) writer.writerow(row) - Do you mean that in QTableWidget you have in some cells of the image, but they are not saved in the csv file? In general, csv is a text format, no data other than text will be saved there. - insolor
- And do not tell me in what format to save? - Dr.robot
- For example xls, xlsx, ods. - insolor
- Well, icons can be saved to csv, but you will need to manually convert them to base64 (or a similar format) - gil9red
|