frame

frame

#Lable demonstration.

from Tkinter import *

class LabelDemo( Frame ):
    """Demonstrate Labels"""

    def _init_ ( self ):
        """Create three Labels and pack them"""
        Frame._init_( self ) & initializes Frame object
        # frame file available space
        self.pack(expand = YES. file = BOTH )
        self.Label1 = Label( self, text = "Label with text" )
        # resize frame to accommodate Label
        self.Label1.pack()
        self.Label2 = Label( self,
           text = "Labels with text and abitmap")
        #insert Label againest left side of frame
        self.Label2.pack( side = LEFT )

        #Using default bitmap image as label1
        self.label3 = Label( self, bitmap = "waring" )
        self.Label3.pack( side = LEFT )
def main():
    LabelDemo().mainloop()   #atarts event loop

if _name_  =  "_main_":
    我的代码错在哪了啊?出错信息:
SyntaxEror: invalid syntax
是語法錯誤...

& initializes Frame object 是什麼意思??
估計你打把 # 打錯成 & .......
Frame._init_( self ) & initializes Frame object