Ticket #7579: createTestTable.py
File createTestTable.py, 485 bytes (added by Arturs Bekasovs, 7 years ago) |
---|
Line | |
---|---|
1 | data = [[-1,-2,-3,-4,-5], |
2 | [1,2,3,4,5], |
3 | [2,4,8,16,32], |
4 | [1,1,1,1,1], |
5 | [2,2,2,2,2], |
6 | [100,200,300,400,500]] |
7 | |
8 | columnRoles = [_qti.Table.X, _qti.Table.X, _qti.Table.Y, _qti.Table.xErr, _qti.Table.yErr, _qti.Table.Label] |
9 | |
10 | t = newTable("TestTable2", len(data[0]), len(data)) |
11 | |
12 | for colNum, row in enumerate(data): |
13 | t.setColumnRole(colNum + 1, columnRoles[colNum]) |
14 | for rowNum, element in enumerate(row): |
15 | t.setCell(colNum + 1, rowNum + 1, element) |