0
Why tkinter window doesn't opens in Pycharm though it works perfectly in IDLE
plzzz help me
9 Respuestas
+ 1
import Tkinter ( In python 2)
import tkinter ( In python 3.x)
maruthi = tkinter.Tk() #produces loop
# your widgets will go here,
(your widget may be button, canvas,checkbutton, entry, label, listbox, menubutton, menu, messege, radio button, scale, scrollbar, text, tkmessegebox etc)
maruthi.mainloop() #action for the main loop
+ 5
Do you get an error of some kind or does it simply not show and ends the program?
+ 2
Code that runs on IDLE but not in pycharm means
your code is correct but something wrong with pycharm, Check build and run configurations
+ 1
james i shows nothing it just exits program
+ 1
oh i just got the solution code is working by putting tk.mainloop() in end and bytheway tk =Tk()
+ 1
Did you close the main loop at the very bottom?
+ 1
yep
+ 1
i am just doing this but can u explain me that what exactly it is doing
+ 1
closing the main loop will take action against each event triggered by the user (window closes only when you click cancel button otherwise it is a infinite loop)
if you don't close the loop it wont take any action