import pcop import pydcop app = pydcop.anyAppCalled("kspread") table = app.default.getViews()[0] table.setSelection( ( 2, 2, 4, 6 ) ) table.setSelectionBgColor( (100, 100, 240) ) print rect print "done"