there is a code:
#coding:utf-8
from Tkinter import * 
from sys import stdout, exit                 # lambda generates a function 
 
widget = Button(None,                        # but contains just an expression 
             text='Hello event world',  
             command=(lambda: stdout.write('Hello lambda world\n') or exit()) ) 
 
widget.pack() 
widget.mainloop()

when you click the button,there is output : Hello lambda world, then exit the 
program.
i am confused, why not use "and" ?  i made a try, if i use "or",the program 
will not exit ,why?
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to