I am trying to add an element to a ttk.Treeview instance in my Python script that creates the base interface. The insert code is as follows:
tree.insert(my_id, 'end', todo_id, text="Line " + str(line_num), values=(str(todo_text), owner), # I have 2 cols, 'text' and 'owner' tags=['
I found that when setting the line todo_text in a column named "text" Tkinter throws an error when it encounters a specific line:
_tkinter.TclError: unmatched open bracket in list
and the only thing I can consider the reason for this is that the specified string contains curly braces. Here is the line where it broke:
'// static class Properties { // TODO, temp class'
It seems to happen if I use todo_text or str(todo_text) .
Is the text string parsed somehow? What am I missing?
source share