Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Python Tkinter new line

+1 vote
asked Nov 25, 2023 by Eidnoxon (5,350 points)

I am making an application that I'm trying to make money out of, but I need this one thing. How can I make newline in python tkinter? Newline like this but in gui: python("text one\n").

from tkinter import *

root = Tk()
label1 = Label(root, text="text one on side", font=("Cascadia Code", 15, "bold"))
label2 = Label(root, text="text two on side", font=("Cascadia Code", 15, "bold"))

RESULT: text one on sidetext two on side
What I expected:
text one on side
text two on side

Please help, and do not make your answer too complicated.

1 Answer

0 votes
answered Nov 26, 2023 by Peter Minarik (89,040 points)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.