tkinter my simple window code is not working

by: antonmichel, 6 years ago

Last edited: 6 years ago


HOW CAN  I SOLVE THIS ?

code :

from tkinter import *

class Window(Frame):

    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.master = master

root = Tk()

app = Window(root)

root.mainloop()

ERROR :
Traceback (most recent call last):
  File "C:/Users/Admin/PycharmProjects/untitled/test.py", line 1, in <module>
    from tkinter import *
ImportError: No module named tkinter




You must be logged in to post. Please login or register an account.



You must be using python 2.x and not 3.x . For 2.x You need to import Tkinter and not tkinter(this is for python 3.x)

-goku 6 years ago

You must be logged in to post. Please login or register an account.