I am not able to insert new line in the output that is generated using Label
in Tkinter. Below is the image of my GUI that explains my problem.
This is the code that I used for defining my label.
string1 = 'At pathID' + str(l.get('pathId'))+
'In label' + str(keys) +':'+
'profile in reference but not in copy' +
str(list(set(a_value)-set(b_value)))
ttk.Label(t.sub_frame, text=string1).pack(side="left", fill="x", expand=1)
What I want:
I want a new line at the beginning of At path ID0 in label.....
So the output in label should look like below and not like shown in one line above in GUI image:
At path ID0 In label1: profile in reference but not in copy[(18,0,0)]
At path ID0 In label2: profile in reference but not in copy[(18,0,8)]
What I tried:
The above shown lines are generated in loop so I tried keeping new line character before start of the line, but it only shows the output from next line yet keeping it attached in one line.
string1 = '\n' + '\nAt pathID' + str(l.get('pathId'))+
'In label' + str(keys) +':'+
'profile in reference but not in copy' +
str(list(set(a_value)-set(b_value)))
The reason I assumed was that at every loop new line character will be encountered and I can get every line printed in newline. Can you guys suggest me something? I think I am missing a minor logic somewhere