Search code examples
pythontkinterjupyter-notebookenthought

Tkinter does not show up


I downloaded Canopy and I would like to use Tkinter and for this, I disabled pylab and ran the program but still nothing showed up. Additionally, I tried tkinter on jupyter and same problem.

How can I make it work?

Here is my code :

import Tkinter as Tk

screen=Tk.Tk()
screen.title("Matplot Graphies")
screen.geometry("500x500")

I tried simple code to see GUI but still nothing happens.


Solution

  • You need to call mainloop() method at the end.

    import Tkinter as Tk
    
    screen=Tk.Tk()
    screen.title("Matplot Graphies")
    screen.geometry("500x500")
    screen.mainloop()