My gui

Ned Batchelder ned at nedbatchelder.com
Wed Apr 24 14:08:29 EDT 2013


On 4/24/2013 1:08 PM, Daniel Kersgaard wrote:
> Today, being the last day of lectures at school, my instructor ran briefly through Tkninter and GUIs. I'd been looking forward to this particular lesson all semester, but when I got home and copied a sample program from my textbook verbatim, IDLE does nothing. No error, no nothing. Any ideas? Here  is the code from my program. I'm not sure if this is appropriate, but suggestions are helpful.
>
> import tkinter
> import tkinter.messagebox
>
> class MyGui:
>      def_init_(self):

You need to define __init__, not _init_.  Python special methods are 
named with double underscore leading and trailing, and __x__ is 
pronounced "dunder-x".

--Ned.



More information about the Python-list mailing list