1from Tkinter import *
2
3root = Tk()
4scrollbar = Scrollbar(root)
5scrollbar.pack( side = RIGHT, fill = Y )
6
7mylist = Listbox(root, yscrollcommand = scrollbar.set )
8for line in range(100):
9 mylist.insert(END, "This is line number " + str(line))
10
11mylist.pack( side = LEFT, fill = BOTH )
12scrollbar.config( command = mylist.yview )
13
14mainloop()