Wednesday, June 15, 2011

Python and Tkinter on Windows

I'm currently taking a beginners course on line at KTH.se. I noticed too late that it was based on programming in Python; but programming is programming after all and it may impress someone ;).

Anyway. I'm trying to complete the final task and for a good grade I have to build a GUI using Tkinter. I found a tutorial but I've been going mad for the last hour or so.

Python has kept saying "ImportError: No module named Tkinter". No matter what i did.

Finally I found the solution. For some reason (that makes no sense at all) it is case sensitive and only lower case letters should be used in the windows enviroment.

Thus the "import Tkinter" is wrong. It should be "import tkinter" without the capital T.

3 comments:

nightowl223 said...

Because Windows always thinks they are the only thing that should be capitalized. 😄 Well, and C:, of course.

nightowl223 said...
This comment has been removed by the author.
nightowl223 said...

Oh, sorry. Didn't realise this was from 8 years ago, on a seemingly abandoned blog.

I found it by searching QWOXY, to see if it was short for something, or stood for something, or meant something secret, etc... I ran across the "term" looking for a team to join for Asteroids@home, since I found a cool team to join for my SETI@home (Doctor Who related, LOL).
Anyway, didn't mean to disturb a dead blog.
RIP, little blog.