Home > Blockchain >  How to insert text line by line in tkinter?
How to insert text line by line in tkinter?

Time:09-17

How do I insert text from a variable so that each item in a variable prints onto a new line if the line is already taken in tkinter?

My code is

 variable = list.get(0, END)
 item = Label(root, text = variable)
 item.pack()

My current result is: current

How I want it to look like: needed

CodePudding user response:

variable is a tuple of strings, so use string.join() to concat those strings into one string:

item = Label(root, text='\n'.join(variable))
  • Related