TTkTableModelCSV

TTkTableModelCSV🌶️

class TTkTableModelCSV(*, filename: str = None, fd=None)[source]🌶️

Bases: TTkTableModelList

TTkTableModelCSV extends TTkTableModelList with cvs loading helpers.

You can address the csv file through the Filename (filename) or the FileDescriptor (fd).

import TermTk as ttk

# TableModel from csv filename
tm1 = ttk.TTkTableModelCSV(filename='path/file.csv')

# TableModel from csv FileDescriptor
with open('path/file.csv') as fd:
    tm2 = ttk.TTkTableModelCSV(fd=fd)
Parameters:
  • filename (str, optional) – the csv filename, if missing the file descriptor is used instead.

  • fd (io, optional) – the FileDescriptor

Signals🌶️

dataChanged

This signal is emitted whenever the data in an existing item changes.

Members🌶️

dataChanged: pyTTkSignal🌶️

This signal is emitted whenever the data in an existing item changes.

If more items are affected, the pos/size definne the minimum area including all of those changes.

When reimplementing the setData() function, this signal must be emitted explicitly.

Parameters:
  • pos (tuple(int,int)) – the topLeft margin of the modified area

  • size (tuple(int,int)) – the size of the modified area