When creating a GUI with tkinter you need to have a single
It creates an infinite loop that runs until the main tkinter window is destroyed.
The
mainloop
that is called at the point you want your GUI to run.It creates an infinite loop that runs until the main tkinter window is destroyed.
The
mainloop
will draw the GUI widgets and react to events such as button presses, as you have seen without it the GUI doesn't function.from tkinter import Tk, Canvas root = Tk() c = Canvas(root, width=800, height=800, bg='black') c.pack() c.create_text(100, 50, anchor='w', fill='orange', font='Arial 28 bold underline', text='....') root.mainloop()