I\'m trying to get the number of displayed lines in a Tkinter Text widget and I\'m looking at this question: What's the most efficient way to get a Tkinter Text widget'
This appears to be a bug in Tkinter. You can use a monkeypatch to add the missing method:
def count_monkeypatch(self, index1, index2, *args):
args = [self._w, "count"] + ["-" + arg for arg in args] + [index1, index2]
result = self.tk.call(*args)
return result
Tkinter.Text.count = count_monkeypatch