(text)
return first, last
Return tuple of 'line.col' indexes from selection or insert mark.
Return tuple of 'line.col' indexes from selection or insert mark.
Return tuple of line . col indexes from selection or insert mark .
def get_selection(text):
    '''Return tuple of 'line.col' indexes from selection or insert mark.
    '''
    try:
        first = text.index("sel.first")
        last = text.index("sel.last")
    except TclError:
        first = last = None
    if not first:
        first = text.index("insert")
    if not last:
        last = first
    return first, last
def get_selection ( text ) : try : first = text . index ( "sel.first" ) last = text . index ( "sel.last" ) except TclError : first = last = None if not first : first = text . index ( "insert" ) if not last : last = first return first , last