python - Problems with creating a window using tkinter -


i trying create program using tkinter , keeps on giving me 1 error:

in __init__ self.master = tk() nameerror: name 'tk' not defined 

i not sure why saying tk isn't defined when importing tkinter, can please explain doing wrong.

here code:

from tkinter import *  class app:     def __init__(self):         self.master = tk()         frame = frame(self.master)         frame.pack()         self.master.minsize(1080,720)         self.master.maxsize(1080,720)         self.master.title("music player")  myapp = app() myapp.mainloop() 

it's tk, not tk. take @ small code given in documentation of tkinter. last 3 lines here you.

import tkinter tk ...  root = tk.tk() app = application(master=root) app.mainloop() 

as matter of fact, think trying code documentation page, yet missed it!


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -