whamTam
1
Could anybody get me started on filling in a table using Python?
For instance, how to I set the value of the first cell ( in [0, 0] )
If it is called table1 I have tried
op('table1').write(op('text1')[0,0].val)
And put text into text1, but it does not work. Any suggestions?
Thanks
elburz
2
If you want to write the value of the text dat into the table:
op(‘table1’)[0,0].val = op(‘text1’).text
You can use .text on Text dats instead of [0,0]. As far as I know, it amounts to the same thing.
rob
3
you could also simply do:
op(‘table1’)[0,0] = op(‘text1’).text
[0,0] and text are identical in the case of single-row, single-column tables.
Note, instead of 0,0 you can also pass in string labels, corresponding to row and column headers:
op(‘tabel1’)[‘month’, ‘sales’] = op(‘text1’).text etc
For more information on how to access cells see:
derivative.ca/wiki088/index. … g_Contents
1 Like