I want to execute function with one click on listbox. This is my idea:
from Tkinter import *
import Tkinter
def immediately():
print Lb1.curselection()
top = Tk()
Lb1 = Listbox(top)
Lb1.insert(1, "Python")
Lb1.insert(2, "Perl")
Lb1.insert(3, "C")
Lb1.insert(4, "PHP")
Lb1.insert(5, "JSP")
Lb1.insert(6, "Ruby")
Lb1.pack()
Lb1.bind('<Button-1>', lambda event :immediately() )
top.mainloop()
But this function print before execute selecting...You will see what is the problrm when you run this code.