0

I have a code in Python and I am trying to create a UI for it using Tkinter. I just started off using Tkinter, and got the following code :

from Tkinter import *

window = Tk()
window.title("Hello world")

window.mainloop()

I am using Jupyter notebook to run the code and it's been several minutes and the code still hasn't given me an output. What exactly wrong with this? Is it the code or Jupyter Notebook?

Nnn
  • 191
  • 3
  • 9
  • What "output" are you expecting? The code should open a window, and will terminate only after you close that window. (Not sure how it behaves in Jupyter, though) – tobias_k Mar 18 '19 at 15:52
  • @tobias_k Yes, I mean the window. I ran the code and it still hasn't opened a window. – Nnn Mar 18 '19 at 16:04
  • I think this might be related to/a duplicate of [this question](https://stackoverflow.com/q/48130916/1639625) or [some other](https://stackoverflow.com/search?q=tkinter+jupyter), don't have Jupyter installed right now to test it, though. – tobias_k Mar 18 '19 at 16:08
  • purely from a tkinter point of view there's nothing wrong with the code. If you run this from the command line you should get a blank window. – Bryan Oakley Mar 18 '19 at 17:16

1 Answers1

2

Probably is because in the first line "Tkinter" has to be all in lower case.

OLDdog
  • 21
  • 3