def _get_selection_cursor(self, start, end):
        """ Get a cursor with text selected between the positions 'start' and
            'end'.
        """
        cursor = self._control.textCursor()
        cursor.setPosition(start)
        cursor.setPosition(end, QtGui.QTextCursor.KeepAnchor)
        return cursor
 Get a cursor with text selected between the positions 'start' and
            'end'.
        
angrmanagement/vendor/qtconsole/console_widget.py