#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    67
    Rep Power
    12

    Unhappy Tkinker problem :(


    When I run this program:
    Note: It's not finished yet
    ------------------------------
    # Dice Roller Program
    # By Evan Patterson

    from Tkinker import *

    class Application(Frame):
    def __init__(self, master=None):
    Frame.__init__(self, master)
    self.grid()
    self.createWidgets()
    def createWidgets(self):
    # Buttons
    self.quitButton = Button ( self, text="Exit", )
    command=self.quit()
    self.quitButton.grid(column=1,row=2)

    # Labels
    self.Label1 = Label ( self, text="# of Rolls", )
    self.Label1(column=0, row=0)
    self.Label2 = Label ( self, text="# of Sides", )
    self.Label2(column=1, row=0)
    self.Label3 = Label ( self, text="Results", )
    self.Label3(column=2, row=0)

    # Entries
    self.Entry1 = Entry ( self, wdth=5)
    self.Entry1(column=0, row=1)
    self.Entry2 = Entry ( self, wdth=5)
    self.Entry2(column=1, row=1)

    # Instantiate the application class
    app = Application()
    app.master.title("Dice Roller")
    app.mainloop()
    ---------------------------------------
    It gives me the following error:
    -------------------------------------
    File "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
    exec codeObject in __main__.__dict__
    File "C:\Python23\My Programs\Dice Roller.txt", line 4, in ?
    from TKinker import *
    ImportError: No module named Tkinker
    ------------------------------------
    I can't figure out why, I mean, I have Tkinker.
    Does anyone know why this is happening?
    Thanks.
    Before you criticize someone, walk a mile in their shoes, that way when you do criticize them, you're a mile away and you have their shoes!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    133
    Rep Power
    12
    It would be much easier to analyze your code if you put the code between code brackets, "[" then "code", then "]", and on the other side, "[", "/code", and "]". That would preserve the formatting of the code.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    67
    Rep Power
    12
    Oh, ok. I'll do that next time.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Norwich, UK
    Posts
    53
    Rep Power
    12
    Code:
    from Tkinker import *
    Shouldn't that be Tkinter? I dunno, maybe there's some variant of Tkinter called Tkinker, but I doubt it.
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    67
    Rep Power
    12
    OMG, I am a moron.
    Thanks.

IMN logo majestic logo threadwatch logo seochat tools logo