Please code review.

Karim kliateni at gmail.com
Tue Aug 2 10:19:05 EDT 2011


On 08/02/2011 03:59 PM, Peter Otten wrote:
> Karim wrote:
>
>> values = ( (22.5,21.5,121.5),
>> (5615.3,615.3,-615.3),
>> (-2315.7,315.7,415.7) )
>>
>> it = _xrange_cellnames(rows=len(value), cols=len(values[0]))
>>
>> table.getCellByName(it.next()).setValue(22.5)
>> table.getCellByName(it.next()).setValue(5615.3)
>> table.getCellByName(it.next()).setValue(-2315.7)
> Some googling suggests that there exists a getCellByPosition() method. With
> that the above would become (untested):
>
> for x, column in enumerate(values):
>      for y, value in enumerate(column):
>          table.getCellByPosition(x, y).setValue(value)

Thanks for the tip I will check com.sun.star.text.TextTable API.

Regards
Karim



More information about the Python-list mailing list