The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
Tkinker problem :(
Discuss Tkinker problem :( in the Python Programming forum on Dev Shed. Tkinker problem :( Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 27th, 2003, 09:09 AM
|
 |
Contributing User
|
|
Join Date: Aug 2003
Posts: 67
Time spent in forums: 41 m
Reputation Power: 10
|
|
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!
|

August 27th, 2003, 10:43 AM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 133
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
|
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.
|

August 27th, 2003, 10:49 AM
|
 |
Contributing User
|
|
Join Date: Aug 2003
Posts: 67
Time spent in forums: 41 m
Reputation Power: 10
|
|
|
Oh, ok. I'll do that next time.
|

August 27th, 2003, 11:45 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Location: Norwich, UK
Posts: 53
Time spent in forums: 9 h 1 m 53 sec
Reputation Power: 11
|
|
Code:
from Tkinker import *
Shouldn't that be Tkin ter? I dunno, maybe there's some variant of Tkinter called Tkinker, but I doubt it.
|

August 27th, 2003, 01:38 PM
|
 |
Contributing User
|
|
Join Date: Aug 2003
Posts: 67
Time spent in forums: 41 m
Reputation Power: 10
|
|
|
OMG, I am a moron.
Thanks.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|