a fix to tkinter output not showing

tkinter is fine once you understand it. let us see what problem user vikas was having and how to fix it!

tkinter no output
tkinter no output

the fix

a basic tkinter skeleton is

import tkinter as tk

root = tk.Tk()

root.mainloop()

now we see that the user has it in place, so no output means the label he defined is not showing.

now the syntax for elements is :

Element(window, …

we see that the user did not specify the window in which the element is to be placed

so, the fix is simple !

title = tk.label(window, text='hello')

 

  •  
  •  
  •  
  •  

Lives in Mauritius, cruising python waters for now.