there is my problem: I am trying to get all numbers from a text widget Tkinter (get text from a file) as follows:
text = self.text_field.get(1.0, 'end')
s = re.findall("\d+", text)
s returns something like this:
[u'0', u'15', u'320', u'235', u'1', u'1', u'150', u'50', u'2', u'2', u'20']
than trying to add tags to a text widget:
for i in s: self.text_field.tag_add('%s', '5.0', '6.0') %s[i]
and this gives an error:
list indices must be integers, not unicode
thanx to help me :)
source
share