Home > Enterprise >  Windows with tkinter
Windows with tkinter

Time:10-31

I started studying Python last Monday. I tried to create a window using tkinter. Pycharm says there are no mistakes but after running the code the window doesn't appear D: That's my code

from tkinter import *

window = Tk()
window.title("thecharmii")
window.geometry("700x500")
window.config(background = "black")

window.mainloop()

I downloaded the latest Python version, I guess it's 3.10. When I click on Run the window doesn't appear but it looks like the process is still running. Thanks for the help

CodePudding user response:

try this

from tkinter import *

def main():
    window = Tk()
    window.title("thecharmii")
    window.geometry("700x500")
    window.config(background = "black")

    window.mainloop()

    
main()

CodePudding user response:

It works completely fine with me. Try running it in your cmd/powershell/terminal.

If it is running, then it might be that the configurations for the file you are working with in pycharm are messed up.

  • Related