import tableproxy from table import TableModel __all__ = ['TableModel'] TableModel = tableproxy.getProxy(TableModel) if __name__ == "__main__": tab = TableModel([('a',str),('b',str),('c',str)]) tab.insertRow(0) tab.insertRow(1) tab[0][0] = "apple" tab[0][1] = 2 tab[0][2] = 3 tab[1][0] = "orange" tab[1][1] = 5 tab[1][2] = 3 tab.printTable() print tab.insertColumn(1,[("extra",int),10,9]) tab.printTable() print c = tab.takeColumn(1) tab.insertColumn(3,c) tab.printTable() print
import tableproxy from transcript import Transcript __all__ = ['Transcript'] Transcript = tableproxy.getProxy(Transcript) if __name__ == "__main__": L = [[(None,None)]*10, ['sw',0,1.23,2.01,'A','male','native','how are you',1,1,1,'report'], ['sw',0,2.01,2.53,'B','female','native',"I'm fine",1,1,2,'report']] trans = Transcript.importList(L) trans.printTable()
import tableproxy from table import TableModel __all__ = ['TableModel'] TableModel = tableproxy.getProxy(TableModel) if __name__ == "__main__": tab = TableModel([('a', str), ('b', str), ('c', str)]) tab.insertRow(0) tab.insertRow(1) tab[0][0] = "apple" tab[0][1] = 2 tab[0][2] = 3 tab[1][0] = "orange" tab[1][1] = 5 tab[1][2] = 3 tab.printTable() print tab.insertColumn(1, [("extra", int), 10, 9]) tab.printTable() print c = tab.takeColumn(1) tab.insertColumn(3, c) tab.printTable() print