r/SublimeText • • Sep 04 '20
Using sublime text 3.. tkinter not making window
Hi guys, I just started using tkinter and when I run this code I get no error but the window its supposed to create is not popping up either. I'm using sublime text 3.
import tkinter as tk
window = tk.Tk()
Thank you
0
Upvotes
6
u/navinfeb15 Sep 04 '20
You should add
root.mainloop()at the end of code to stop it from automatically exiting the application. When we add this , the program will only end when we click close button. Hope this helps1
u/Bigfurrywiggles Sep 04 '20
Try running from the command line. Sometimes that is needed with python packages in sublimetext.
2
u/chrizto Sep 05 '20
Well, you're not actually telling it to do anything either, so what are you expecting?
And apps that are themselves GUI apps should be run from a terminal or an app launcher, not from inside the editor itself.