(self)
return head, tail, chars, lines
Return line information about the selected text region.

        If text is selected, the first and last indices will be
        for the selection.  If there is no text selected, the
        indices will be the current cursor location.

        Return a tuple containing (first index, last index,
            string representation of text, list of text lines).
Return line information about the selected text region.
Return line information about the selected text region .
def get_region(self):
        """Return line information about the selected text region.

        If text is selected, the first and last indices will be
        for the selection.  If there is no text selected, the
        indices will be the current cursor location.

        Return a tuple containing (first index, last index,
            string representation of text, list of text lines).
        """
        text = self.editwin.text
        first, last = self.editwin.get_selection_indices()
        if first and last:
            head = text.index(first + " linestart")
            tail = text.index(last + "-1c lineend +1c")
        else:
            head = text.index("insert linestart")
            tail = text.index("insert lineend +1c")
        chars = text.get(head, tail)
        lines = chars.split("\n")
        return head, tail, chars, lines
def get_region ( self ) : text = self . editwin . text first , last = self . editwin . get_selection_indices ( ) if first and last : head = text . index ( first + " linestart" ) tail = text . index ( last + "-1c lineend +1c" ) else : head = text . index ( "insert linestart" ) tail = text . index ( "insert lineend +1c" ) chars = text . get ( head , tail ) lines = chars . split ( "\n" ) return head , tail , chars , lines