Skip to content
Advertisement

Printing a list to a Tkinter Text widget

I have a list of strings, and I want to print those strings in a Tkinter text widget, but I can’t insert each string in a new line.

I tried this but didn’t work:

JavaScript

Advertisement

Answer

Append newline ('n') manually:

JavaScript

BTW, you don’t need to use index to iterate a list. Just iterate the list. And don’t use list as a variable name. It shadows builtin function/type list.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement