title: How to convert ablosution position returned from re.finditer to row.column needed for a tkinter Text Widget?
body: <p>I am using re.finditer to search for words in a tkinter text widget. This returns absolution positions for found items in the string, not row.column.</p>
  
  <p>Now I need to convert this to row.column, however there seems to be no method to do this. However, in researching documentation <a href="https://infohost.nmt.edu/tcc/help/pubs/tkinter/web/text-methods.html" rel="nofollow noreferrer">here</a>, it shows this, which doesn't work and gives the below error, and <a href="http://effbot.org/tkinterbook/text.htm" rel="nofollow noreferrer">this</a> which I found no option to do what i need:  </p>
  
  <pre><code>.index(i)
  
      For an index i, this method returns the equivalent position in the form 'line.char'. 
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>loc = text.index(11)
  Python Debugger 2:02:16 PM
    File "C:\Programs\Python37\lib\tkinter\__init__.py", line 3268, in index
  Python Debugger 2:02:16 PM
      return str(self.tk.call(self._w, 'index', index))
  </code></pre>
  
  <p>So, how can I accomplish getting row.column from absolution position?</p>
  
  <p>Background info:
  I have config file's I'm trying to search and highlight found items using tags. I'm using the below code to find the start index of the found items as well as the item itself so I know the length (since this uses regex and found items will not necessarily be the same length). I then created an OrderedDict so I can loop through it and highlight all found items.</p>
  
  <p>The problem is that adding a tag doesn't work without absolute position, it requires row.column which I have no way to get from re.finditer. </p>
  
  <p>Relevant code. For testing I am simply passing in StrToFind, and assume this is a long bit of text rows, separated by a \n. I can make it work if it's a long string without any \n's, but then the config being searched is incredibly hard to read.</p>
  
  <pre><code>import tkinter as tk
  import re
  import itertools
  from collections import OrderedDict
  
  def findStr(strToFind, strBeingSearched):
      '''returns OrderedDict of start locations and the word found'''
      wordlst = re.findall(strToFind, strBeingSearched) #get words found so I can know the length
      lst = [m.start() for m in re.finditer(strToFind, strBeingSearched)] #get index position of each word
      d = OrderedDict(zip(lst, wordlst)) #create ordered dict from 2 lists.
      return d
  
  def btnFindAllClick(event):
      global search, color
      search[color] = findStr('StrToFind', text.get("1.0", tk.END))
      for index, word in search[color].items():
          length = len(word)
          text.tag_add(color, index, index + length) #this is where it breaks because I don't have row.column!
  
  search = {}
  color = 'yellow'
  
  root = tk.Tk()
  text = tk.Text(root, height=10, wrap="word")
  text.pack(fill="both", expand=True)
  text.tag_configure(color, background="yellow", foreground="black")
  text.tag_raise("sel")
  
  btn = tk.Button(root, text="Find All", width=12)
  btn.pack(side="right")
  btn.bind("&lt;Button-1&gt;", btnFindAllClick)
  
  root.mainloop()
  </code></pre>