TkInter: how to get actual text modification?
<p>I want to know where and what  was changed by user in tkinter's <code>Text</code> widget. </p>

<p>I've found how to get that text was <em>somehow</em> modified by using <code>&lt;&lt;Modified&gt;&gt;</code>event but I can't get actual changes: </p>

<pre><code>from tkinter import *

def reset_modified():
    global resetting_modified
    resetting_modified = True
    text.tk.call(text._w, 'edit', 'modified', 0)
    resetting_modified = False

def on_change(ev=None):
    if resetting_modified: return
    print ("Text now:\n%s" % text.get("1.0", END))
    if False: # ???? 
        print ("Deleted [deleted substring] from row %d col %d")
    if False: # ????
        print ("Inserted [inserted substring] at row %d col %d")
    reset_modified()

resetting_modified = False
root = Tk()
text = Text(root)
text.insert(END, "Hello\nworld")
text.pack()
text.bind("&lt;&lt;Modified&gt;&gt;", on_change)
reset_modified()
root.mainloop()
</code></pre>

<p>For example, if I select 'ello' part from "hello\nworld" in <code>Text</code> widget then I press 'E', then I want to see </p>

<p>"Deleted [ello] from row 0 col 1" followed by "Inserted [E] at row 0 col 1"</p>

<p>is it possible to get such changes (or at least their coordinates) or I have basically to <code>diff</code> text on each keystroke if I want to detect changes run time?</p>