Results 1 to 4 of 4

Thread: No Module Named TKinter : Python 2.6

  1. #1
    Join Date
    Oct 2008
    Location
    INDIA
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Thumbs down No Module Named TKinter : Python 2.6

    Hello there,

    I am using Python 2.6 and Geany as my Programming IDE. Please have a look in the simple code as below:

    Code:
    #!/usr/local/bin/python
    from TKinter import *
    
    class Application(Frame):
        def __init__(self, master=None):
            Frame.__init__(self,master)
            self.grid()
            self.createWidgets()
        
        def createWidgets():
            self.quitButton = Button(self, text='Quit', command=self.Quit)
            self.quitButton.grid()
    
    app = Application()
    app.master.title('Sample Application')
    app.mainloop()
    I had python-tk, tcl and tk installed but still the above code is showing the error:

    No Module Named TKinter.

    Please help.
    Controlling complexity is the essence of computer programming. - Brian

  2. #2
    Join Date
    Jun 2010
    Location
    Loznica Serbia
    Beans
    126
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: No Module Named TKinter : Python 2.6

    It's not TKinter but Tkinter
    Windows is not user friendly,it's just user familiar

  3. #3
    Join Date
    Oct 2008
    Location
    INDIA
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: No Module Named TKinter : Python 2.6

    Quote Originally Posted by nidzo732 View Post
    It's not TKinter but Tkinter
    Thanks that solved the problem.

    But now one more occurred:

    TypeError: createWidgets() takes no arguments (1 given)
    Controlling complexity is the essence of computer programming. - Brian

  4. #4
    Join Date
    Oct 2008
    Location
    INDIA
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: No Module Named TKinter : Python 2.6

    Solved every thing, here is the actual code:

    There were some typos:

    Code:
    #!/usr/local/bin/python
    from Tkinter import *
    
    class Application(Frame):
        def __init__(self, master=None):
            Frame.__init__(self,master)
            self.grid()
            self.createWidgets()
        
        def createWidgets(self):
            self.quitButton = Button(self, text='Quit', command=self.quit)
            self.quitButton.grid()
    
    app = Application()
    app.master.title('Sample Application')
    app.mainloop()
    Controlling complexity is the essence of computer programming. - Brian

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •