python - 'module' object has no attribute 'TK' -


i'm beginner of learning gui.

my python version 2.7 , i'm using windows.

i've searched tkinter in folder there 1 python file in c:\python27.

here code:

import tkinter tk   class electronic_signature_user_program(tk.tk):     def __init__(self,*args,**kwargs):         tk.tk.__init__(self, *args, **kwargs)          container = tk.frame(self)         container.pack(side = "top",fill = "both",expand = true)         container.grid_rowconfigure(0,weight=1)         container.grid_columnconfigure(0,weight=1)          self.frames = {}          f in (loginpage, login_confirm):             frame = loginpage(container,self)             self.frames[loginpage] = frame             frame.grid(row=0,column=0,sticky="nsew")          self.show_frame(loginpage)      def show_frame(self,cont):         frame = self.frames[cont]         frame.tkraise()  class loginpage(tk.frame):     def __init__(self, parent, controller):         tk.frame.__init__(self, parent)         button1 = tk.button(self,text="login_confirm",command=lambda:controller.show_frame(login_confirm))         button1.pack()  class login_confirm(tk.frame):     def __init__(self, parent, controller):         tk.frame.__init__(self, parent)         button2 = tk.button(self,text="loginpage",command=lambda:controller.show_frame(loginpage))         button2.pack()   app = electronic_signature_user_program() app.title('uol 702 electrinic signature user program') app.mainloop() 

in first class declaration have tk should tk.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -