import Tkinter
F1 = Tkinter.Frame()
s = Tkinter.Scrollbar(F1)
L = Tkinter.Listbox(F1)
s.pack(side=Tkinter.RIGHT, fill=Tkinter.Y)
L.pack(side=Tkinter.LEFT, fill=Tkinter.Y)
s['command'] = L.yview
L['yscrollcommand'] = s.set
for i in range(30):
L.insert(Tkinter.END, str(i))
F1.pack(side=Tkinter.TOP)
F2 = Tkinter.Frame()
lab = Tkinter.Label(F2)
def poll():
lab.after(200, poll)
sel = L.curselection()
lab.config(text=str(sel))
lab.pack()
F2.pack(side=Tkinter.TOP)
poll()
Tkinter.mainloop()
aW1wb3J0IFRraW50ZXIKCkYxID0gVGtpbnRlci5GcmFtZSgpCnMgPSBUa2ludGVyLlNjcm9sbGJhcihGMSkKTCA9IFRraW50ZXIuTGlzdGJveChGMSkKCnMucGFjayhzaWRlPVRraW50ZXIuUklHSFQsIGZpbGw9VGtpbnRlci5ZKQpMLnBhY2soc2lkZT1Ua2ludGVyLkxFRlQsIGZpbGw9VGtpbnRlci5ZKQoKc1snY29tbWFuZCddID0gTC55dmlldwpMWyd5c2Nyb2xsY29tbWFuZCddID0gcy5zZXQKCmZvciBpIGluIHJhbmdlKDMwKTogCiAgIEwuaW5zZXJ0KFRraW50ZXIuRU5ELCBzdHIoaSkpCgpGMS5wYWNrKHNpZGU9VGtpbnRlci5UT1ApCgpGMiA9IFRraW50ZXIuRnJhbWUoKQpsYWIgPSBUa2ludGVyLkxhYmVsKEYyKQoKZGVmIHBvbGwoKToKICAgIGxhYi5hZnRlcigyMDAsIHBvbGwpCiAgICBzZWwgPSBMLmN1cnNlbGVjdGlvbigpCiAgICBsYWIuY29uZmlnKHRleHQ9c3RyKHNlbCkpCgpsYWIucGFjaygpCkYyLnBhY2soc2lkZT1Ua2ludGVyLlRPUCkKCnBvbGwoKQpUa2ludGVyLm1haW5sb29wKCk=