def select_row(view, row):
 selmodel = view.selectionModel()
 selmodel.select(view.model().index(row, 0), QItemSelectionModel.ClearAndSelect)

def select_row ( view , row ) : selmodel = view . selectionModel ( ) selmodel . select ( view . model ( ) . index ( row , 0 ) , QItemSelectionModel . ClearAndSelect )
select a row in an item view .